зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1749477 - new array methods should be unscopable; r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D137281
This commit is contained in:
Родитель
cb32ea121d
Коммит
d64d8cad2e
|
@ -4128,6 +4128,15 @@ static bool array_proto_finish(JSContext* cx, JS::HandleObject ctor,
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
if (cx->realm()->creationOptions().getArrayGroupingEnabled()) {
|
||||
if (!DefineDataProperty(cx, unscopables, cx->names().groupBy, value) ||
|
||||
!DefineDataProperty(cx, unscopables, cx->names().groupByToMap, value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
if (cx->options().changeArrayByCopy()) {
|
||||
if (!DefineDataProperty(cx, unscopables, cx->names().withAt, value) ||
|
||||
|
|
|
@ -44,6 +44,11 @@ if (getBuildConfiguration()['change-array-by-copy'] && getRealmConfiguration().e
|
|||
expectedKeys.push("withAt", "withReversed", "withSorted", "withSpliced");
|
||||
}
|
||||
|
||||
if (!getBuildConfiguration().release_or_beta && getRealmConfiguration().enableArrayGrouping) {
|
||||
expectedKeys.push("groupBy", "groupByToMap");
|
||||
expectedKeys.sort();
|
||||
}
|
||||
|
||||
assertDeepEq(keys, expectedKeys);
|
||||
|
||||
for (let key of keys)
|
||||
|
|
Загрузка…
Ссылка в новой задаче