Small fix in ScriptingCore.cpp.

This commit is contained in:
James Chen 2013-10-11 21:52:55 +08:00
parent edcf9fecb4
commit c914017c16
1 changed files with 4 additions and 5 deletions

View File

@ -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()