Bug 1712180 - Make GetOwnProperty on the Window named properties object return supported properties that are indices. r=evilpie

Differential Revision: https://phabricator.services.mozilla.com/D115638
This commit is contained in:
Peter Van der Beken 2021-05-26 17:11:33 +00:00
Родитель f1e4c7eafa
Коммит 74db47a136
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -77,7 +77,7 @@ bool WindowNamedPropertiesHandler::getOwnPropDescriptor(
JS::MutableHandle<Maybe<JS::PropertyDescriptor>> aDesc) const { JS::MutableHandle<Maybe<JS::PropertyDescriptor>> aDesc) const {
aDesc.reset(); aDesc.reset();
if (!JSID_IS_STRING(aId)) { if (aId.isSymbol()) {
if (aId.isWellKnownSymbol(JS::SymbolCode::toStringTag)) { if (aId.isWellKnownSymbol(JS::SymbolCode::toStringTag)) {
JS::Rooted<JSString*> toStringTagStr( JS::Rooted<JSString*> toStringTagStr(
aCx, JS_NewStringCopyZ(aCx, "WindowProperties")); aCx, JS_NewStringCopyZ(aCx, "WindowProperties"));
@ -91,7 +91,7 @@ bool WindowNamedPropertiesHandler::getOwnPropDescriptor(
return true; return true;
} }
// Nothing to do if we're resolving another non-string property. // Nothing to do if we're resolving another symbol property.
return true; return true;
} }
@ -104,7 +104,7 @@ bool WindowNamedPropertiesHandler::getOwnPropDescriptor(
} }
nsAutoJSString str; nsAutoJSString str;
if (!str.init(aCx, JSID_TO_STRING(aId))) { if (!str.init(aCx, aId)) {
return false; return false;
} }