mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 637014 - use the right global in MakeFinalizeObserver (r=luke)
This commit is contained in:
parent
e47bd654e8
commit
6ab97d439e
@ -482,10 +482,14 @@ static JSClass FinalizeCounterClass = {
|
||||
static JSBool
|
||||
MakeFinalizeObserver(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
JSObject *obj = JS_NewObjectWithGivenProto(cx, &FinalizeCounterClass, NULL,
|
||||
JS_GetGlobalObject(cx));
|
||||
JSObject *scope = JS_GetGlobalForScopeChain(cx);
|
||||
if (!scope)
|
||||
return false;
|
||||
|
||||
JSObject *obj = JS_NewObjectWithGivenProto(cx, &FinalizeCounterClass, NULL, scope);
|
||||
if (!obj)
|
||||
return false;
|
||||
|
||||
*vp = OBJECT_TO_JSVAL(obj);
|
||||
return true;
|
||||
}
|
||||
|
2
js/src/jit-test/tests/basic/testBug637014.js
Normal file
2
js/src/jit-test/tests/basic/testBug637014.js
Normal file
@ -0,0 +1,2 @@
|
||||
var o = newGlobal('new-compartment');
|
||||
o.makeFinalizeObserver();
|
Loading…
Reference in New Issue
Block a user