mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 831291 - GC: jsapi test Debugger fails under rooting analysis r=billm
--HG-- extra : rebase_source : 5ee77ba14d8e9e68db2c16ba8767021f9ee959b5
This commit is contained in:
parent
27e3f8ac0c
commit
a9926ea468
@ -161,15 +161,15 @@ BEGIN_TEST(testDebugger_debuggerObjectVsDebugMode)
|
|||||||
|
|
||||||
js::RootedObject debuggeeWrapper(cx, debuggee);
|
js::RootedObject debuggeeWrapper(cx, debuggee);
|
||||||
CHECK(JS_WrapObject(cx, debuggeeWrapper.address()));
|
CHECK(JS_WrapObject(cx, debuggeeWrapper.address()));
|
||||||
jsval v = OBJECT_TO_JSVAL(debuggeeWrapper);
|
js::RootedValue v(cx, JS::ObjectValue(*debuggeeWrapper));
|
||||||
CHECK(JS_SetProperty(cx, global, "debuggee", &v));
|
CHECK(JS_SetProperty(cx, global, "debuggee", v.address()));
|
||||||
|
|
||||||
EVAL("var dbg = new Debugger(debuggee);\n"
|
EVAL("var dbg = new Debugger(debuggee);\n"
|
||||||
"var hits = 0;\n"
|
"var hits = 0;\n"
|
||||||
"dbg.onDebuggerStatement = function () { hits++; };\n"
|
"dbg.onDebuggerStatement = function () { hits++; };\n"
|
||||||
"debuggee.eval('debugger;');\n"
|
"debuggee.eval('debugger;');\n"
|
||||||
"hits;\n",
|
"hits;\n",
|
||||||
&v);
|
v.address());
|
||||||
CHECK_SAME(v, JSVAL_ONE);
|
CHECK_SAME(v, JSVAL_ONE);
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -179,7 +179,7 @@ BEGIN_TEST(testDebugger_debuggerObjectVsDebugMode)
|
|||||||
|
|
||||||
EVAL("debuggee.eval('debugger; debugger; debugger;');\n"
|
EVAL("debuggee.eval('debugger; debugger; debugger;');\n"
|
||||||
"hits;\n",
|
"hits;\n",
|
||||||
&v);
|
v.address());
|
||||||
CHECK_SAME(v, INT_TO_JSVAL(4));
|
CHECK_SAME(v, INT_TO_JSVAL(4));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -199,8 +199,8 @@ BEGIN_TEST(testDebugger_newScriptHook)
|
|||||||
|
|
||||||
js::RootedObject gWrapper(cx, g);
|
js::RootedObject gWrapper(cx, g);
|
||||||
CHECK(JS_WrapObject(cx, gWrapper.address()));
|
CHECK(JS_WrapObject(cx, gWrapper.address()));
|
||||||
jsval v = OBJECT_TO_JSVAL(gWrapper);
|
js::RootedValue v(cx, JS::ObjectValue(*gWrapper));
|
||||||
CHECK(JS_SetProperty(cx, global, "g", &v));
|
CHECK(JS_SetProperty(cx, global, "g", v.address()));
|
||||||
|
|
||||||
EXEC("var dbg = Debugger(g);\n"
|
EXEC("var dbg = Debugger(g);\n"
|
||||||
"var hits = 0;\n"
|
"var hits = 0;\n"
|
||||||
@ -226,6 +226,7 @@ bool testIndirectEval(JS::HandleObject scope, const char *code)
|
|||||||
JSString *codestr = JS_NewStringCopyZ(cx, code);
|
JSString *codestr = JS_NewStringCopyZ(cx, code);
|
||||||
CHECK(codestr);
|
CHECK(codestr);
|
||||||
jsval argv[1] = { STRING_TO_JSVAL(codestr) };
|
jsval argv[1] = { STRING_TO_JSVAL(codestr) };
|
||||||
|
JS::AutoArrayRooter rooter(cx, 1, argv);
|
||||||
jsval v;
|
jsval v;
|
||||||
CHECK(JS_CallFunctionName(cx, scope, "eval", 1, argv, &v));
|
CHECK(JS_CallFunctionName(cx, scope, "eval", 1, argv, &v));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user