1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-27 01:25:34 +00: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:
witekfl 2011-04-25 21:04:03 +02:00
parent 2844f8b715
commit 218a2250a7
2 changed files with 4 additions and 1 deletions

View File

@ -305,7 +305,7 @@ spidermonkey_eval_stringback(struct ecmascript_interpreter *interpreter,
if (ret == JS_FALSE) {
return NULL;
}
if (JSVAL_IS_VOID(rval)) {
if (JSVAL_IS_VOID(rval) || JSVAL_IS_NULL(rval)) {
/* Undefined value. */
return NULL;
}

View File

@ -78,6 +78,7 @@ history_back(JSContext *ctx, uintN argc, jsval *rval)
* and return non zero for <a href="javascript:history.back()"> to prevent
* "calculating" new link. Returned value 2 is changed to 0 in function
* spidermonkey_eval_boolback */
JS_SET_RVAL(ctx, rval, JSVAL_NULL);
return 2;
}
@ -91,6 +92,7 @@ history_forward(JSContext *ctx, uintN argc, jsval *rval)
go_unback(ses);
JS_SET_RVAL(ctx, rval, JSVAL_NULL);
return 2;
}
@ -121,6 +123,7 @@ history_go(JSContext *ctx, uintN argc, jsval *rval)
index += index > 0 ? -1 : 1;
}
JS_SET_RVAL(ctx, rval, JSVAL_NULL);
return 2;
}