mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1097987 part 2. Change JS shell's Run to always compile/execute the script in global scope instead of using its this object. r=waldo
This commit is contained in:
parent
38cddbe9ac
commit
0d622c0e8f
@ -1462,10 +1462,6 @@ Run(JSContext *cx, unsigned argc, jsval *vp)
|
||||
return false;
|
||||
}
|
||||
|
||||
RootedObject thisobj(cx, JS_THIS_OBJECT(cx, vp));
|
||||
if (!thisobj)
|
||||
return false;
|
||||
|
||||
RootedString str(cx, JS::ToString(cx, args[0]));
|
||||
if (!str)
|
||||
return false;
|
||||
@ -1493,11 +1489,11 @@ Run(JSContext *cx, unsigned argc, jsval *vp)
|
||||
.setFileAndLine(filename.ptr(), 1)
|
||||
.setCompileAndGo(true)
|
||||
.setNoScriptRval(true);
|
||||
if (!JS_CompileUCScript(cx, thisobj, ucbuf, buflen, options, &script))
|
||||
if (!JS_CompileUCScript(cx, cx->global(), ucbuf, buflen, options, &script))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!JS_ExecuteScript(cx, thisobj, script))
|
||||
if (!JS_ExecuteScript(cx, cx->global(), script))
|
||||
return false;
|
||||
|
||||
int64_t endClock = PRMJ_Now();
|
||||
|
Loading…
Reference in New Issue
Block a user