mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 610078 - Return the value when we found it on a proxy. r=brendan a=blocking betaN
This commit is contained in:
parent
4d18c6aeca
commit
1c6917d3c3
@ -3128,16 +3128,26 @@ LookupResult(JSContext *cx, JSObject *obj, JSObject *obj2, jsid id,
|
||||
}
|
||||
|
||||
/* Peek at the native property's slot value, without doing a Get. */
|
||||
if (obj2->containsSlot(shape->slot))
|
||||
if (obj2->containsSlot(shape->slot)) {
|
||||
*vp = obj2->nativeGetSlot(shape->slot);
|
||||
else
|
||||
vp->setBoolean(true);
|
||||
} else if (obj2->isDenseArray()) {
|
||||
return js_GetDenseArrayElementValue(cx, obj2, id, vp);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
/* XXX bad API: no way to return "defined but value unknown" */
|
||||
vp->setBoolean(true);
|
||||
if (obj2->isDenseArray())
|
||||
return js_GetDenseArrayElementValue(cx, obj2, id, vp);
|
||||
if (obj2->isProxy()) {
|
||||
AutoPropertyDescriptorRooter desc(cx);
|
||||
if (!JSProxy::getPropertyDescriptor(cx, obj2, id, false, &desc))
|
||||
return false;
|
||||
if (!(desc.attrs & JSPROP_SHARED)) {
|
||||
*vp = desc.value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* XXX bad API: no way to return "defined but value unknown" */
|
||||
vp->setBoolean(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user