diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-14 08:52:37 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-14 08:52:37 +0200 |
commit | 6452e3c9785260f21c5013d31e855e7b3e0497f4 (patch) | |
tree | 93cbcc1593efd16e5455711865b4790cbe5719c0 /js/src/builtin/ModuleObject.cpp | |
parent | e2719e1dbf7b706cd5ec8b3ecd899d2fc063c20f (diff) | |
download | UXP-6452e3c9785260f21c5013d31e855e7b3e0497f4.tar UXP-6452e3c9785260f21c5013d31e855e7b3e0497f4.tar.gz UXP-6452e3c9785260f21c5013d31e855e7b3e0497f4.tar.lz UXP-6452e3c9785260f21c5013d31e855e7b3e0497f4.tar.xz UXP-6452e3c9785260f21c5013d31e855e7b3e0497f4.zip |
Bug 1326453 - Part 4: Return @@toStringTag in [[OwnPropertyKeys]] trap for module namespace objects
Diffstat (limited to 'js/src/builtin/ModuleObject.cpp')
-rw-r--r-- | js/src/builtin/ModuleObject.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/js/src/builtin/ModuleObject.cpp b/js/src/builtin/ModuleObject.cpp index 28a3329a8..6d42508e0 100644 --- a/js/src/builtin/ModuleObject.cpp +++ b/js/src/builtin/ModuleObject.cpp @@ -500,7 +500,7 @@ ModuleNamespaceObject::ProxyHandler::ownPropertyKeys(JSContext* cx, HandleObject Rooted<ModuleNamespaceObject*> ns(cx, &proxy->as<ModuleNamespaceObject>()); RootedObject exports(cx, &ns->exports()); uint32_t count; - if (!GetLengthProperty(cx, exports, &count) || !props.reserve(props.length() + count)) + if (!GetLengthProperty(cx, exports, &count) || !props.reserve(props.length() + count + 1)) return false; Rooted<ValueVector> names(cx, ValueVector(cx)); @@ -510,6 +510,8 @@ ModuleNamespaceObject::ProxyHandler::ownPropertyKeys(JSContext* cx, HandleObject for (uint32_t i = 0; i < count; i++) props.infallibleAppend(AtomToId(&names[i].toString()->asAtom())); + props.infallibleAppend(SYMBOL_TO_JSID(cx->wellKnownSymbols().toStringTag)); + return true; } |