mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
SpiderMonkey: fix issue with javascript:history.back()
In history.back() and others set rval to NULL. Do not convert NULL to string in spidermoney_eval_stringback.
This commit is contained in:
parent
2844f8b715
commit
218a2250a7
@ -305,7 +305,7 @@ spidermonkey_eval_stringback(struct ecmascript_interpreter *interpreter,
|
|||||||
if (ret == JS_FALSE) {
|
if (ret == JS_FALSE) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (JSVAL_IS_VOID(rval)) {
|
if (JSVAL_IS_VOID(rval) || JSVAL_IS_NULL(rval)) {
|
||||||
/* Undefined value. */
|
/* Undefined value. */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,7 @@ history_back(JSContext *ctx, uintN argc, jsval *rval)
|
|||||||
* and return non zero for <a href="javascript:history.back()"> to prevent
|
* and return non zero for <a href="javascript:history.back()"> to prevent
|
||||||
* "calculating" new link. Returned value 2 is changed to 0 in function
|
* "calculating" new link. Returned value 2 is changed to 0 in function
|
||||||
* spidermonkey_eval_boolback */
|
* spidermonkey_eval_boolback */
|
||||||
|
JS_SET_RVAL(ctx, rval, JSVAL_NULL);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +92,7 @@ history_forward(JSContext *ctx, uintN argc, jsval *rval)
|
|||||||
|
|
||||||
go_unback(ses);
|
go_unback(ses);
|
||||||
|
|
||||||
|
JS_SET_RVAL(ctx, rval, JSVAL_NULL);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +123,7 @@ history_go(JSContext *ctx, uintN argc, jsval *rval)
|
|||||||
index += index > 0 ? -1 : 1;
|
index += index > 0 ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JS_SET_RVAL(ctx, rval, JSVAL_NULL);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user