mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
Bug 1340268 - [[HasProperty]] on module namespace object should work even when binding is uninitialized
This commit is contained in:
parent
e82ffc59bb
commit
b79662ba48
1 changed files with 5 additions and 3 deletions
|
|
@ -330,7 +330,7 @@ ModuleNamespaceObject::addBinding(JSContext* cx, HandleAtom exportedName,
|
||||||
const char ModuleNamespaceObject::ProxyHandler::family = 0;
|
const char ModuleNamespaceObject::ProxyHandler::family = 0;
|
||||||
|
|
||||||
ModuleNamespaceObject::ProxyHandler::ProxyHandler()
|
ModuleNamespaceObject::ProxyHandler::ProxyHandler()
|
||||||
: BaseProxyHandler(&family, true)
|
: BaseProxyHandler(&family, false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -438,7 +438,8 @@ ModuleNamespaceObject::ProxyHandler::has(JSContext* cx, HandleObject proxy, Hand
|
||||||
Rooted<ModuleNamespaceObject*> ns(cx, &proxy->as<ModuleNamespaceObject>());
|
Rooted<ModuleNamespaceObject*> ns(cx, &proxy->as<ModuleNamespaceObject>());
|
||||||
if (JSID_IS_SYMBOL(id)) {
|
if (JSID_IS_SYMBOL(id)) {
|
||||||
Rooted<JS::Symbol*> symbol(cx, JSID_TO_SYMBOL(id));
|
Rooted<JS::Symbol*> symbol(cx, JSID_TO_SYMBOL(id));
|
||||||
return symbol == cx->wellKnownSymbols().toStringTag;
|
*bp = symbol == cx->wellKnownSymbols().toStringTag;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
*bp = ns->bindings().has(id);
|
*bp = ns->bindings().has(id);
|
||||||
|
|
@ -457,7 +458,8 @@ ModuleNamespaceObject::ProxyHandler::get(JSContext* cx, HandleObject proxy, Hand
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
vp.setUndefined();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModuleEnvironmentObject* env;
|
ModuleEnvironmentObject* env;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue