mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 887334 - Fix JSAPI test harness to not fail when the initial compartment is null. r=luke
I don't know why it's done this way, but it sure needs to change.
This commit is contained in:
parent
b6dac750a0
commit
6934cef71d
@ -23,8 +23,8 @@ bool JSAPITest::init()
|
||||
JS::RootedObject global(cx, createGlobal());
|
||||
if (!global)
|
||||
return false;
|
||||
oldCompartment = JS_EnterCompartment(cx, global);
|
||||
return oldCompartment != NULL;
|
||||
JS_EnterCompartment(cx, global);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JSAPITest::exec(const char *bytes, const char *filename, int lineno)
|
||||
|
@ -81,6 +81,7 @@ class JSAPITest
|
||||
}
|
||||
if (cx) {
|
||||
JS_RemoveObjectRoot(cx, &global);
|
||||
JS_LeaveCompartment(cx, NULL);
|
||||
JS_EndRequest(cx);
|
||||
JS_DestroyContext(cx);
|
||||
cx = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user