Bug 1256688 - Change BPH::has to follow [[HasProperty]] for ordinary objects. r=jorendorff
This commit is contained in:
@@ -259,35 +259,6 @@ BaseDOMProxyHandler::getOwnEnumerablePropertyKeys(JSContext* cx,
|
||||
return ownPropNames(cx, proxy, JSITER_OWNONLY, props);
|
||||
}
|
||||
|
||||
bool
|
||||
DOMProxyHandler::has(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id, bool* bp) const
|
||||
{
|
||||
if (!hasOwn(cx, proxy, id, bp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (*bp) {
|
||||
// We have the property ourselves; no need to worry about our prototype
|
||||
// chain.
|
||||
return true;
|
||||
}
|
||||
|
||||
// OK, now we have to look at the proto
|
||||
JS::Rooted<JSObject*> proto(cx);
|
||||
if (!js::GetObjectProto(cx, proxy, &proto)) {
|
||||
return false;
|
||||
}
|
||||
if (!proto) {
|
||||
return true;
|
||||
}
|
||||
bool protoHasProp;
|
||||
bool ok = JS_HasPropertyById(cx, proto, id, &protoHasProp);
|
||||
if (ok) {
|
||||
*bp = protoHasProp;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
DOMProxyHandler::setCustom(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||
JS::Handle<JS::Value> v, bool *done) const
|
||||
|
||||
Reference in New Issue
Block a user