mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Relanding mrbkap's patch for bug 369259 since backing it out didn't fix our perf test woes
This commit is contained in:
parent
7b5790be13
commit
c959381531
@ -4662,11 +4662,29 @@ nsWindowSH::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
printf(" --- Forwarding add to inner window %p\n", (void *)innerWin);
|
||||
#endif
|
||||
|
||||
// Forward the add to the inner object
|
||||
jsid interned_id;
|
||||
*_retval = (::JS_ValueToId(cx, id, &interned_id) &&
|
||||
OBJ_DEFINE_PROPERTY(cx, innerObj, interned_id, *vp, nsnull,
|
||||
nsnull, JSPROP_ENUMERATE, nsnull));
|
||||
if (!::JS_ValueToId(cx, id, &interned_id)) {
|
||||
*_retval = JS_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
JSProperty *prop = nsnull;
|
||||
JSObject *pobj;
|
||||
if (!OBJ_LOOKUP_PROPERTY(cx, obj, interned_id, &pobj, &prop)) {
|
||||
*_retval = JS_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_ASSERTION(prop && obj == pobj, "The JS engine lies");
|
||||
JSScopeProperty *sprop = reinterpret_cast<JSScopeProperty *>(prop);
|
||||
JSPropertyOp getter = sprop->getter;
|
||||
JSPropertyOp setter = sprop->setter;
|
||||
uintN attrs = sprop->attrs;
|
||||
OBJ_DROP_PROPERTY(cx, pobj, prop);
|
||||
|
||||
// Forward the add to the inner object
|
||||
*_retval = OBJ_DEFINE_PROPERTY(cx, innerObj, interned_id, *vp, getter,
|
||||
setter, attrs | JSPROP_ENUMERATE, nsnull);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user