From c914017c16e53fcb3dd1020f15531818aabf9575 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 11 Oct 2013 21:52:55 +0800 Subject: [PATCH] Small fix in ScriptingCore.cpp. --- scripting/javascript/bindings/ScriptingCore.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index caf3603beb..101005be60 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -1935,16 +1935,15 @@ void SimpleRunLoop::update(float dt) } } -void ScriptingCore::debugProcessInput(string str) { +void ScriptingCore::debugProcessInput(string str) +{ JSAutoCompartment ac(_cx, _debugGlobal); JSString* jsstr = JS_NewStringCopyZ(_cx, str.c_str()); - jsval argv[] = { - STRING_TO_JSVAL(jsstr) - }; + jsval argv = STRING_TO_JSVAL(jsstr); jsval outval; - JS_CallFunctionName(_cx, _debugGlobal, "processInput", 1, argv, &outval); + JS_CallFunctionName(_cx, _debugGlobal, "processInput", 1, &argv, &outval); } static bool NS_ProcessNextEvent()