mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
Bug 1341256 - Fix module namespace object get handler
This commit is contained in:
parent
b79662ba48
commit
eaf8fcd215
2 changed files with 7 additions and 2 deletions
|
|
@ -464,8 +464,10 @@ ModuleNamespaceObject::ProxyHandler::get(JSContext* cx, HandleObject proxy, Hand
|
|||
|
||||
ModuleEnvironmentObject* env;
|
||||
Shape* shape;
|
||||
if (!ns->bindings().lookup(id, &env, &shape))
|
||||
return false;
|
||||
if (!ns->bindings().lookup(id, &env, &shape)) {
|
||||
vp.setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
RootedValue value(cx, env->getSlot(shape->slot()));
|
||||
if (value.isMagic(JS_UNINITIALIZED_LEXICAL)) {
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ b.evaluation();
|
|||
testHasNames(getModuleEnvironmentNames(b), ["ns", "x"]);
|
||||
let ns = getModuleEnvironmentValue(b, "ns");
|
||||
testHasNames(Object.keys(ns), ["a", "b"]);
|
||||
assertEq(ns.a, 1);
|
||||
assertEq(ns.b, 2);
|
||||
assertEq(ns.c, undefined);
|
||||
assertEq(getModuleEnvironmentValue(b, "x"), 3);
|
||||
|
||||
// Test module namespace internal methods as defined in 9.4.6
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue