Bug 399094 - "Wrappers don't deal with non-native objects". Patch by Blake Kaplan <mrbkap@gmail.com>, r+sr+a=jst.

This commit is contained in:
bent.mozilla@gmail.com 2007-10-08 23:16:55 -07:00
parent cb240a8164
commit dcf0aa1c00

View File

@ -167,12 +167,16 @@ XPCWrapper::NewResolve(JSContext *cx, JSObject *wrapperObj,
} }
JSBool isXOW = (JS_GET_CLASS(cx, wrapperObj) == &sXPC_XOW_JSClass.base); JSBool isXOW = (JS_GET_CLASS(cx, wrapperObj) == &sXPC_XOW_JSClass.base);
JSScopeProperty *sprop = reinterpret_cast<JSScopeProperty *>(prop); uintN attrs = JSPROP_ENUMERATE;
uintN attrs = sprop->attrs; if (OBJ_IS_NATIVE(innerObjp)) {
if ((preserveVal || isXOW) && JSScopeProperty *sprop = reinterpret_cast<JSScopeProperty *>(prop);
SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(innerObjp))) { attrs = sprop->attrs;
v = OBJ_GET_SLOT(cx, innerObjp, sprop->slot); if ((preserveVal || isXOW) &&
} SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(innerObjp))) {
v = OBJ_GET_SLOT(cx, innerObjp, sprop->slot);
}
}
OBJ_DROP_PROPERTY(cx, innerObjp, prop); OBJ_DROP_PROPERTY(cx, innerObjp, prop);
// Hack alert: we only do this for same-origin calls on XOWs: we want // Hack alert: we only do this for same-origin calls on XOWs: we want