зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1749477, bug 1750955) for causing reftest failures on unscopables.js CLOSED TREE
Backed out changeset d63e96d23111 (bug 1749477) Backed out changeset faf29999cc23 (bug 1749477) Backed out changeset 0ed606582c39 (bug 1750955)
This commit is contained in:
Родитель
38cc60cc90
Коммит
1ad3bc1249
|
@ -51,12 +51,9 @@ class JS_PUBLIC_API ContextOptions {
|
|||
fuzzing_(false),
|
||||
privateClassFields_(false),
|
||||
privateClassMethods_(false),
|
||||
#ifdef NIGHTLY_BUILD
|
||||
arrayGrouping_(true),
|
||||
#endif
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
changeArrayByCopy_(false),
|
||||
#endif
|
||||
#endif
|
||||
ergonomicBrandChecks_(false),
|
||||
classStaticBlocks_(false),
|
||||
importAssertions_(false) {
|
||||
|
@ -169,14 +166,6 @@ class JS_PUBLIC_API ContextOptions {
|
|||
return *this;
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
bool arrayGrouping() const { return arrayGrouping_; }
|
||||
ContextOptions& setArrayGrouping(bool enabled) {
|
||||
arrayGrouping_ = enabled;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
bool changeArrayByCopy() const { return changeArrayByCopy_; }
|
||||
ContextOptions& setChangeArrayByCopy(bool enabled) {
|
||||
|
@ -306,9 +295,6 @@ class JS_PUBLIC_API ContextOptions {
|
|||
bool fuzzing_ : 1;
|
||||
bool privateClassFields_ : 1;
|
||||
bool privateClassMethods_ : 1;
|
||||
#ifdef NIGHTLY_BUILD
|
||||
bool arrayGrouping_ : 1;
|
||||
#endif
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
bool changeArrayByCopy_ : 1;
|
||||
#endif
|
||||
|
|
|
@ -232,14 +232,6 @@ class JS_PUBLIC_API RealmCreationOptions {
|
|||
return *this;
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
bool getArrayGroupingEnabled() const { return arrayGrouping_; }
|
||||
RealmCreationOptions& setArrayGroupingEnabled(bool flag) {
|
||||
arrayGrouping_ = flag;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NEW_SET_METHODS
|
||||
bool getNewSetMethodsEnabled() const { return newSetMethods_; }
|
||||
RealmCreationOptions& setNewSetMethodsEnabled(bool flag) {
|
||||
|
@ -286,9 +278,6 @@ class JS_PUBLIC_API RealmCreationOptions {
|
|||
bool toSource_ = false;
|
||||
bool propertyErrorMessageFix_ = false;
|
||||
bool iteratorHelpers_ = false;
|
||||
#ifdef NIGHTLY_BUILD
|
||||
bool arrayGrouping_ = true;
|
||||
#endif
|
||||
#ifdef ENABLE_NEW_SET_METHODS
|
||||
bool newSetMethods_ = false;
|
||||
#endif
|
||||
|
|
|
@ -4128,15 +4128,6 @@ 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) ||
|
||||
|
|
|
@ -358,7 +358,7 @@ function ArrayGroupBy(callbackfn/*, thisArg*/) {
|
|||
}
|
||||
|
||||
/* Step 7. Let obj be ! OrdinaryObjectCreate(null). */
|
||||
var object = std_Object_create(null);
|
||||
var object = {};
|
||||
|
||||
/* Step 8. For each Record { [[Key]], [[Elements]] } g of groups, do
|
||||
* a. Let elements be ! CreateArrayFromList(g.[[Elements]]).
|
||||
|
|
|
@ -208,14 +208,6 @@ static bool GetRealmConfiguration(JSContext* cx, unsigned argc, Value* vp) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
bool arrayGrouping = cx->options().arrayGrouping();
|
||||
if (!JS_SetProperty(cx, info, "enableArrayGrouping",
|
||||
arrayGrouping ? TrueHandleValue : FalseHandleValue)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
bool changeArrayByCopy = cx->options().changeArrayByCopy();
|
||||
if (!JS_SetProperty(cx, info, "enableChangeArrayByCopy",
|
||||
|
|
|
@ -625,9 +625,6 @@ bool shell::enableWeakRefs = false;
|
|||
bool shell::enableToSource = false;
|
||||
bool shell::enablePropertyErrorMessageFix = false;
|
||||
bool shell::enableIteratorHelpers = false;
|
||||
#ifdef NIGHTLY_BUILD
|
||||
bool shell::enableArrayGrouping = true;
|
||||
#endif
|
||||
bool shell::enablePrivateClassFields = false;
|
||||
bool shell::enablePrivateClassMethods = false;
|
||||
bool shell::enableErgonomicBrandChecks = true;
|
||||
|
@ -4246,9 +4243,6 @@ static void SetStandardRealmOptions(JS::RealmOptions& options) {
|
|||
.setToSourceEnabled(enableToSource)
|
||||
.setPropertyErrorMessageFixEnabled(enablePropertyErrorMessageFix)
|
||||
.setIteratorHelpersEnabled(enableIteratorHelpers)
|
||||
#ifdef NIGHTLY_BUILD
|
||||
.setArrayGroupingEnabled(enableArrayGrouping)
|
||||
#endif
|
||||
#ifdef ENABLE_NEW_SET_METHODS
|
||||
.setNewSetMethodsEnabled(enableNewSetMethods)
|
||||
#endif
|
||||
|
@ -11060,9 +11054,6 @@ static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
|
|||
enablePropertyErrorMessageFix =
|
||||
!op.getBoolOption("disable-property-error-message-fix");
|
||||
enableIteratorHelpers = op.getBoolOption("enable-iterator-helpers");
|
||||
#ifdef NIGHTLY_BUILD
|
||||
enableArrayGrouping = op.getBoolOption("enable-array-grouping");
|
||||
#endif
|
||||
enablePrivateClassFields = !op.getBoolOption("disable-private-fields");
|
||||
enablePrivateClassMethods = !op.getBoolOption("disable-private-methods");
|
||||
enableErgonomicBrandChecks =
|
||||
|
@ -11105,9 +11096,6 @@ static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
|
|||
.setPrivateClassFields(enablePrivateClassFields)
|
||||
.setPrivateClassMethods(enablePrivateClassMethods)
|
||||
.setErgnomicBrandChecks(enableErgonomicBrandChecks)
|
||||
#ifdef NIGHTLY_BUILD
|
||||
.setArrayGrouping(enableArrayGrouping)
|
||||
#endif
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
.setChangeArrayByCopy(enableChangeArrayByCopy)
|
||||
#endif
|
||||
|
@ -12045,8 +12033,6 @@ int main(int argc, char** argv) {
|
|||
"property of null or undefined") ||
|
||||
!op.addBoolOption('\0', "enable-iterator-helpers",
|
||||
"Enable iterator helpers") ||
|
||||
!op.addBoolOption('\0', "enable-array-grouping",
|
||||
"Enable Array Grouping") ||
|
||||
!op.addBoolOption('\0', "disable-private-fields",
|
||||
"Disable private class fields") ||
|
||||
!op.addBoolOption('\0', "disable-private-methods",
|
||||
|
|
|
@ -132,7 +132,6 @@ extern bool enableWeakRefs;
|
|||
extern bool enableToSource;
|
||||
extern bool enablePropertyErrorMessageFix;
|
||||
extern bool enableIteratorHelpers;
|
||||
extern bool enableArrayGrouping;
|
||||
extern bool enablePrivateClassFields;
|
||||
extern bool enablePrivateClassMethods;
|
||||
extern bool enableErgonomicBrandChecks;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// |reftest| shell-option(--enable-array-grouping) skip-if(release_or_beta)
|
||||
// |reftest| skip-if(release_or_beta)
|
||||
|
||||
var BUGNUMBER = 1739648;
|
||||
var summary = "Implement Array.prototype.groupByToMap || groupBy";
|
||||
|
@ -15,21 +15,16 @@ function isNeg(x) {
|
|||
{
|
||||
const a1 = [-Infinity, -2, -1, -0, 0, 1, 2, Infinity];
|
||||
const expectedObj = { neg: [-Infinity, -2, -1, -0], pos: [0, 1, 2, Infinity] };
|
||||
Object.setPrototypeOf(expectedObj, null);
|
||||
|
||||
const groupedArray = a1.groupBy(x => isNeg(x) ? 'neg' : 'pos');
|
||||
const mappedArray = a1.groupByToMap(x => isNeg(x) ? 'neg' : 'pos');
|
||||
|
||||
assertEq(Object.getPrototypeOf(groupedArray), null)
|
||||
assertDeepEq(groupedArray, expectedObj);
|
||||
assertDeepEq(mappedArray.get("neg"), expectedObj["neg"]);
|
||||
assertDeepEq(mappedArray.get("pos"), expectedObj["pos"]);
|
||||
|
||||
|
||||
const expectedObj2 = {"undefined": [1,2,3]}
|
||||
Object.setPrototypeOf(expectedObj2, null);
|
||||
assertDeepEq([1,2,3].groupBy(() => {}), expectedObj2);
|
||||
assertDeepEq([].groupBy(() => {}), Object.create(null));
|
||||
assertDeepEq([1,2,3].groupBy(() => {}), {"undefined": [1,2,3]});
|
||||
assertDeepEq([].groupBy(() => {}), {});
|
||||
assertDeepEq(([1,2,3].groupByToMap(() => {})).get(undefined), [1,2,3]);
|
||||
assertEq(([1,2,3].groupByToMap(() => {})).size, 1);
|
||||
|
||||
|
|
|
@ -44,11 +44,6 @@ 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)
|
||||
|
|
|
@ -219,8 +219,6 @@
|
|||
MACRO_(global, global, "global") \
|
||||
MACRO_(globalThis, globalThis, "globalThis") \
|
||||
MACRO_(group, group, "group") \
|
||||
MACRO_(groupBy, groupBy, "groupBy") \
|
||||
MACRO_(groupByToMap, groupByToMap, "groupByToMap") \
|
||||
MACRO_(groups, groups, "groups") \
|
||||
MACRO_(h11, h11, "h11") \
|
||||
MACRO_(h12, h12, "h12") \
|
||||
|
|
|
@ -2162,15 +2162,6 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
if (key == JSProto_Array &&
|
||||
!cx->realm()->creationOptions().getArrayGroupingEnabled() &&
|
||||
(id == NameToId(cx->names().groupBy) ||
|
||||
id == NameToId(cx->names().groupByToMap))) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
if (key == JSProto_Array && !cx->options().changeArrayByCopy() &&
|
||||
(id == NameToId(cx->names().withAt) ||
|
||||
|
|
|
@ -774,9 +774,6 @@ static mozilla::Atomic<bool> sPropertyErrorMessageFixEnabled(false);
|
|||
static mozilla::Atomic<bool> sWeakRefsEnabled(false);
|
||||
static mozilla::Atomic<bool> sWeakRefsExposeCleanupSome(false);
|
||||
static mozilla::Atomic<bool> sIteratorHelpersEnabled(false);
|
||||
#ifdef NIGHTLY_BUILD
|
||||
static mozilla::Atomic<bool> sArrayGroupingEnabled(true);
|
||||
#endif
|
||||
|
||||
static JS::WeakRefSpecifier GetWeakRefsEnabled() {
|
||||
if (!sWeakRefsEnabled) {
|
||||
|
@ -803,9 +800,6 @@ void xpc::SetPrefableRealmOptions(JS::RealmOptions& options) {
|
|||
.setPropertyErrorMessageFixEnabled(sPropertyErrorMessageFixEnabled)
|
||||
.setWeakRefsEnabled(GetWeakRefsEnabled())
|
||||
.setIteratorHelpersEnabled(sIteratorHelpersEnabled)
|
||||
#ifdef NIGHTLY_BUILD
|
||||
.setArrayGroupingEnabled(sArrayGroupingEnabled)
|
||||
#endif
|
||||
#ifdef ENABLE_NEW_SET_METHODS
|
||||
.setNewSetMethodsEnabled(enableNewSetMethods)
|
||||
#endif
|
||||
|
@ -1009,8 +1003,6 @@ static void ReloadPrefsCallback(const char* pref, void* aXpccx) {
|
|||
#ifdef NIGHTLY_BUILD
|
||||
sIteratorHelpersEnabled =
|
||||
Preferences::GetBool(JS_OPTIONS_DOT_STR "experimental.iterator_helpers");
|
||||
sArrayGroupingEnabled =
|
||||
Preferences::GetBool(JS_OPTIONS_DOT_STR "experimental.array_grouping");
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NEW_SET_METHODS
|
||||
|
|
|
@ -6477,12 +6477,6 @@
|
|||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Experimental support for Array Grouping in JavaScript.
|
||||
- name: javascript.options.experimental.array_grouping
|
||||
type: bool
|
||||
value: true
|
||||
mirror: always
|
||||
#endif // NIGHTLY_BUILD
|
||||
|
||||
# Experimental support for class static blocks in JavaScript.
|
||||
|
|
Загрузка…
Ссылка в новой задаче