From 0c721096ec2b9b7daa636e41013fb9f3f6bb66b6 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 2 May 2013 09:03:24 +0800 Subject: [PATCH] fixed #2099:fixed a bug in ScriptingCore::evalString not setting the outval --- scripting/javascript/bindings/ScriptingCore.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index b4a52bc319..9809871e38 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -354,7 +354,6 @@ void ScriptingCore::string_report(jsval val) { JSBool ScriptingCore::evalString(const char *string, jsval *outVal, const char *filename, JSContext* cx, JSObject* global) { - jsval rval; if (cx == NULL) cx = cx_; if (global == NULL) @@ -363,7 +362,7 @@ JSBool ScriptingCore::evalString(const char *string, jsval *outVal, const char * if (script) { // JSAutoCompartment ac(cx, global); JSAutoCompartment ac(cx, global); - JSBool evaluatedOK = JS_ExecuteScript(cx, global, script, &rval); + JSBool evaluatedOK = JS_ExecuteScript(cx, global, script, outVal); if (JS_FALSE == evaluatedOK) { fprintf(stderr, "(evaluatedOK == JS_FALSE)\n"); }