mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 479288 - Move wrapping back into the outerObject hook. r+sr=bent/jst
This commit is contained in:
parent
1a4ca1407d
commit
14658eb0ed
@ -831,7 +831,8 @@ js_ComputeGlobalThis(JSContext *cx, JSBool lazy, jsval *argv)
|
||||
thisp = parent;
|
||||
}
|
||||
|
||||
OBJ_TO_OUTER_OBJECT(cx, thisp);
|
||||
/* Some objects (e.g., With) delegate 'this' to another object. */
|
||||
thisp = OBJ_THIS_OBJECT(cx, thisp);
|
||||
if (!thisp)
|
||||
return NULL;
|
||||
argv[-1] = OBJECT_TO_JSVAL(thisp);
|
||||
@ -855,19 +856,12 @@ ComputeThis(JSContext *cx, JSBool lazy, jsval *argv)
|
||||
return js_ComputeGlobalThis(cx, lazy, argv);
|
||||
}
|
||||
|
||||
OBJ_TO_OUTER_OBJECT(cx, thisp);
|
||||
if (!thisp)
|
||||
return NULL;
|
||||
argv[-1] = OBJECT_TO_JSVAL(thisp);
|
||||
|
||||
if (thisp->map->ops->thisObject) {
|
||||
/* Some objects (e.g., With) delegate 'this' to another object. */
|
||||
thisp = thisp->map->ops->thisObject(cx, thisp);
|
||||
thisp = OBJ_THIS_OBJECT(cx, thisp);
|
||||
if (!thisp)
|
||||
return NULL;
|
||||
argv[-1] = OBJECT_TO_JSVAL(thisp);
|
||||
}
|
||||
}
|
||||
return thisp;
|
||||
}
|
||||
|
||||
@ -1551,7 +1545,7 @@ js_Execute(JSContext *cx, JSObject *chain, JSScript *script,
|
||||
|
||||
cx->fp = &frame;
|
||||
if (!down) {
|
||||
OBJ_TO_OUTER_OBJECT(cx, frame.thisp);
|
||||
frame.thisp = OBJ_THIS_OBJECT(cx, frame.thisp);
|
||||
if (!frame.thisp) {
|
||||
ok = JS_FALSE;
|
||||
goto out2;
|
||||
|
@ -169,7 +169,6 @@ obj_getSlot(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
uintN attrs;
|
||||
JSObject *pobj;
|
||||
JSClass *clasp;
|
||||
JSExtendedClass *xclasp;
|
||||
|
||||
slot = (uint32) JSVAL_TO_INT(id);
|
||||
if (id == INT_TO_JSVAL(JSSLOT_PROTO)) {
|
||||
@ -190,16 +189,13 @@ obj_getSlot(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
||||
if (clasp == &js_CallClass || clasp == &js_BlockClass) {
|
||||
/* Censor activations and lexical scopes per ECMA-262. */
|
||||
*vp = JSVAL_NULL;
|
||||
} else if (clasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
xclasp = (JSExtendedClass *) clasp;
|
||||
if (xclasp->outerObject) {
|
||||
pobj = xclasp->outerObject(cx, pobj);
|
||||
} else if (pobj->map->ops->thisObject) {
|
||||
pobj = pobj->map->ops->thisObject(cx, pobj);
|
||||
if (!pobj)
|
||||
return JS_FALSE;
|
||||
*vp = OBJECT_TO_JSVAL(pobj);
|
||||
}
|
||||
}
|
||||
}
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
@ -1320,6 +1320,10 @@ XPC_WN_JSOp_ThisObject(JSContext *cx, JSObject *obj)
|
||||
if(!XPCPerThreadData::IsMainThread(cx))
|
||||
return obj;
|
||||
|
||||
OBJ_TO_OUTER_OBJECT(cx, obj);
|
||||
if(!obj)
|
||||
return nsnull;
|
||||
|
||||
JSObject *scope = JS_GetScopeChain(cx);
|
||||
if(!scope)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user