mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 19:47:32 +09:00
Bug 1326453 - Part 4: Return @@toStringTag in [[OwnPropertyKeys]] trap for module namespace objects
This commit is contained in:
parent
50765b944e
commit
184438aa10
2 changed files with 20 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue