From 218a2250a7488400c6185e1be2e10adcd2c21106 Mon Sep 17 00:00:00 2001 From: witekfl Date: Mon, 25 Apr 2011 21:04:03 +0200 Subject: [PATCH] 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. --- src/ecmascript/spidermonkey.c | 2 +- src/ecmascript/spidermonkey/location.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ecmascript/spidermonkey.c b/src/ecmascript/spidermonkey.c index 26c5f915..bf96ecd7 100644 --- a/src/ecmascript/spidermonkey.c +++ b/src/ecmascript/spidermonkey.c @@ -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; } diff --git a/src/ecmascript/spidermonkey/location.c b/src/ecmascript/spidermonkey/location.c index 752a8906..d1fbdfb0 100644 --- a/src/ecmascript/spidermonkey/location.c +++ b/src/ecmascript/spidermonkey/location.c @@ -78,6 +78,7 @@ history_back(JSContext *ctx, uintN argc, jsval *rval) * and return non zero for 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; } -- 2.11.4.GIT