summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/ModuleObject.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-14 08:56:17 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-14 08:56:17 +0200
commit05505d2e83d0c11beb6bc8b5c5a0daf68934c342 (patch)
tree231ea8ad5a95b8ab98f4c82317b09eb442bd17e0 /js/src/builtin/ModuleObject.cpp
parentba6602b2de951beb74ef0f43a1cbae33ff0548e2 (diff)
downloadUXP-05505d2e83d0c11beb6bc8b5c5a0daf68934c342.tar
UXP-05505d2e83d0c11beb6bc8b5c5a0daf68934c342.tar.gz
UXP-05505d2e83d0c11beb6bc8b5c5a0daf68934c342.tar.lz
UXP-05505d2e83d0c11beb6bc8b5c5a0daf68934c342.tar.xz
UXP-05505d2e83d0c11beb6bc8b5c5a0daf68934c342.zip
Bug 1340268 - [[HasProperty]] on module namespace object should work even when binding is uninitialized
Diffstat (limited to 'js/src/builtin/ModuleObject.cpp')
-rw-r--r--js/src/builtin/ModuleObject.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/src/builtin/ModuleObject.cpp b/js/src/builtin/ModuleObject.cpp
index 6d42508e0..f13a2b78a 100644
--- a/js/src/builtin/ModuleObject.cpp
+++ b/js/src/builtin/ModuleObject.cpp
@@ -330,7 +330,7 @@ ModuleNamespaceObject::addBinding(JSContext* cx, HandleAtom exportedName,
const char ModuleNamespaceObject::ProxyHandler::family = 0;
ModuleNamespaceObject::ProxyHandler::ProxyHandler()
- : BaseProxyHandler(&family, true)
+ : BaseProxyHandler(&family, false)
{}
bool
@@ -438,7 +438,8 @@ ModuleNamespaceObject::ProxyHandler::has(JSContext* cx, HandleObject proxy, Hand
Rooted<ModuleNamespaceObject*> ns(cx, &proxy->as<ModuleNamespaceObject>());
if (JSID_IS_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);
@@ -457,7 +458,8 @@ ModuleNamespaceObject::ProxyHandler::get(JSContext* cx, HandleObject proxy, Hand
return true;
}
- return false;
+ vp.setUndefined();
+ return true;
}
ModuleEnvironmentObject* env;