Fix so JSNewResolveOp can define id in an unrelated object and return it (not needed now for 274784, may be useful later, good for js, r=shaver).

This commit is contained in:
brendan%mozilla.org 2005-03-24 22:28:09 +00:00
parent db9fbee649
commit 67a8f727f7

View File

@ -2542,7 +2542,10 @@ js_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, jsid id, uintN flags,
if (scope->object == obj2)
sprop = SCOPE_GET_PROPERTY(scope, id);
}
if (obj2 != obj && !sprop) {
if (sprop) {
JS_ASSERT(obj2 == scope->object);
obj = obj2;
} else if (obj2 != obj) {
JS_UNLOCK_OBJ(cx, obj2);
JS_LOCK_OBJ(cx, obj);
}