зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1795816, bug 1833946) for causing multiple failures on test_xrayToJS.xhtml.
Backed out changeset 25ce4c12dfca (bug 1795816) Backed out changeset a05698163bc8 (bug 1795816) Backed out changeset 70e3ee0a0312 (bug 1833946)
This commit is contained in:
Родитель
6072b65316
Коммит
0c63be14bc
|
@ -290,7 +290,7 @@ class JS_PUBLIC_API RealmCreationOptions {
|
|||
// Pref for String.prototype.{is,to}WellFormed() methods.
|
||||
bool wellFormedUnicodeStrings_ = false;
|
||||
#endif
|
||||
bool arrayFromAsync_ = true;
|
||||
bool arrayFromAsync_ = false;
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
bool changeArrayByCopy_ = false;
|
||||
#endif
|
||||
|
|
|
@ -4910,7 +4910,9 @@ static const JSFunctionSpec array_methods[] = {
|
|||
static const JSFunctionSpec array_static_methods[] = {
|
||||
JS_INLINABLE_FN("isArray", array_isArray, 1, 0, ArrayIsArray),
|
||||
JS_SELF_HOSTED_FN("from", "ArrayFrom", 3, 0),
|
||||
#ifdef NIGHTLY_BUILD
|
||||
JS_SELF_HOSTED_FN("fromAsync", "ArrayFromAsync", 3, 0),
|
||||
#endif
|
||||
JS_FN("of", array_of, 0, 0),
|
||||
|
||||
JS_FS_END};
|
||||
|
|
|
@ -832,9 +832,8 @@ function ArrayKeys() {
|
|||
return CreateArrayIterator(this, ITEM_KIND_KEY);
|
||||
}
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
// https://tc39.es/proposal-array-from-async/
|
||||
// TODO: Bug 1834560 The step numbers in this will need updating when this is merged
|
||||
// into the main spec.
|
||||
function ArrayFromAsync(asyncItems, mapfn = undefined, thisArg = undefined) {
|
||||
// Step 1. Let C be the this value.
|
||||
var C = this;
|
||||
|
@ -878,6 +877,12 @@ function ArrayFromAsync(asyncItems, mapfn = undefined, thisArg = undefined) {
|
|||
}
|
||||
}
|
||||
|
||||
// Step 3.e. If IsConstructor(C) is true, then
|
||||
// Step 3.e.i. Let A be ? Construct(C).
|
||||
// Step 3.f. Else,
|
||||
// Step 3.f.i. Let A be ! ArrayCreate(0).
|
||||
let A = IsConstructor(C) ? constructContentFunction(C, C) : [];
|
||||
|
||||
// Step 3.g. Let iteratorRecord be undefined.
|
||||
// Step 3.j. If iteratorRecord is not undefined, then ...
|
||||
if (usingAsyncIterator !== undefined || usingSyncIterator !== undefined) {
|
||||
|
@ -893,14 +898,6 @@ function ArrayFromAsync(asyncItems, mapfn = undefined, thisArg = undefined) {
|
|||
// Step 3.i. Else if usingSyncIterator is not undefined, then
|
||||
// Set iteratorRecord to ? CreateAsyncFromSyncIterator(GetIterator(asyncItems, sync, usingSyncIterator)).
|
||||
|
||||
// https://github.com/tc39/proposal-array-from-async/pull/41
|
||||
// Step 3.e. If IsConstructor(C) is true, then
|
||||
// Step 3.e.i. Let A be ? Construct(C).
|
||||
// Step 3.f. Else,
|
||||
// Step 3.f.i. Let A be ! ArrayCreate(0).
|
||||
let A = IsConstructor(C) ? constructContentFunction(C, C) : [];
|
||||
|
||||
|
||||
// Step 3.j.i. Let k be 0.
|
||||
let k = 0;
|
||||
|
||||
|
@ -967,7 +964,9 @@ function ArrayFromAsync(asyncItems, mapfn = undefined, thisArg = undefined) {
|
|||
// Step 3.k.iv.1. Let A be ? Construct(C, « 𝔽(len) »).
|
||||
// Step 3.k.v. Else,
|
||||
// Step 3.k.v.1. Let A be ? ArrayCreate(len).
|
||||
let A = IsConstructor(C) ? constructContentFunction(C, C, len) : std_Array(len);
|
||||
// Note: This double construction isn't great, issue is open:
|
||||
// https://github.com/tc39/proposal-array-from-async/issues/35
|
||||
A = IsConstructor(C) ? constructContentFunction(C, C, len) : std_Array(len);
|
||||
|
||||
// Step 3.k.vi. Let k be 0.
|
||||
let k = 0;
|
||||
|
@ -1005,6 +1004,7 @@ function ArrayFromAsync(asyncItems, mapfn = undefined, thisArg = undefined) {
|
|||
// Step 5. Return promiseCapability.[[Promise]].
|
||||
return fromAsyncClosure();
|
||||
}
|
||||
#endif
|
||||
|
||||
// ES 2017 draft 0f10dba4ad18de92d47d421f378233a2eae8f077 22.1.2.1
|
||||
function ArrayFrom(items, mapfn = undefined, thisArg = undefined) {
|
||||
|
|
|
@ -623,9 +623,9 @@ bool shell::enableToSource = false;
|
|||
bool shell::enablePropertyErrorMessageFix = false;
|
||||
bool shell::enableIteratorHelpers = false;
|
||||
bool shell::enableShadowRealms = false;
|
||||
bool shell::enableArrayFromAsync = true;
|
||||
#ifdef NIGHTLY_BUILD
|
||||
bool shell::enableArrayGrouping = false;
|
||||
bool shell::enableArrayFromAsync = false;
|
||||
// Pref for String.prototype.{is,to}WellFormed() methods.
|
||||
bool shell::enableWellFormedUnicodeStrings = false;
|
||||
#endif
|
||||
|
@ -3893,9 +3893,9 @@ static void SetStandardRealmOptions(JS::RealmOptions& options) {
|
|||
.setPropertyErrorMessageFixEnabled(enablePropertyErrorMessageFix)
|
||||
.setIteratorHelpersEnabled(enableIteratorHelpers)
|
||||
.setShadowRealmsEnabled(enableShadowRealms)
|
||||
.setArrayFromAsyncEnabled(enableArrayFromAsync)
|
||||
#ifdef NIGHTLY_BUILD
|
||||
.setArrayGroupingEnabled(enableArrayGrouping)
|
||||
.setArrayFromAsyncEnabled(enableArrayFromAsync)
|
||||
.setWellFormedUnicodeStringsEnabled(enableWellFormedUnicodeStrings)
|
||||
#endif
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
|
@ -11384,9 +11384,9 @@ bool InitOptionParser(OptionParser& op) {
|
|||
"Enable iterator helpers") ||
|
||||
!op.addBoolOption('\0', "enable-shadow-realms", "Enable ShadowRealms") ||
|
||||
!op.addBoolOption('\0', "enable-array-grouping",
|
||||
"Enable Array.grouping") ||
|
||||
!op.addBoolOption('\0', "enable-array-from-async",
|
||||
"Enable Array.fromAsync") ||
|
||||
!op.addBoolOption('\0', "enable-array-from-async",
|
||||
"Enable Array Grouping") ||
|
||||
!op.addBoolOption('\0', "enable-well-formed-unicode-strings",
|
||||
"Enable String.prototype.{is,to}WellFormed() methods"
|
||||
"(Well-Formed Unicode Strings)") ||
|
||||
|
@ -11908,9 +11908,9 @@ bool SetContextOptions(JSContext* cx, const OptionParser& op) {
|
|||
!op.getBoolOption("disable-property-error-message-fix");
|
||||
enableIteratorHelpers = op.getBoolOption("enable-iterator-helpers");
|
||||
enableShadowRealms = op.getBoolOption("enable-shadow-realms");
|
||||
enableArrayFromAsync = op.getBoolOption("enable-array-from-async");
|
||||
#ifdef NIGHTLY_BUILD
|
||||
enableArrayGrouping = op.getBoolOption("enable-array-grouping");
|
||||
enableArrayFromAsync = op.getBoolOption("enable-array-from-async");
|
||||
enableWellFormedUnicodeStrings =
|
||||
op.getBoolOption("enable-well-formed-unicode-strings");
|
||||
#endif
|
||||
|
|
|
@ -2228,7 +2228,6 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
|
|||
id == NameToId(cx->names().groupToMap))) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// It's gently surprising that this is JSProto_Function, but the trick
|
||||
// to realize is that this is a -constructor function-, not a function
|
||||
|
@ -2238,6 +2237,7 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
|
|||
id == NameToId(cx->names().fromAsync)) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
if (key == JSProto_Array &&
|
||||
|
|
|
@ -785,7 +785,7 @@ static mozilla::Atomic<bool> sWellFormedUnicodeStringsEnabled(false);
|
|||
#ifdef ENABLE_CHANGE_ARRAY_BY_COPY
|
||||
static mozilla::Atomic<bool> sChangeArrayByCopyEnabled(false);
|
||||
#endif
|
||||
static mozilla::Atomic<bool> sArrayFromAsyncEnabled(true);
|
||||
static mozilla::Atomic<bool> sArrayFromAsyncEnabled(false);
|
||||
#ifdef ENABLE_NEW_SET_METHODS
|
||||
static mozilla::Atomic<bool> sEnableNewSetMethods(false);
|
||||
#endif
|
||||
|
|
|
@ -7617,10 +7617,10 @@
|
|||
value: false
|
||||
mirror: always
|
||||
|
||||
# Support Array.fromAsync
|
||||
# Experimental support Array.fromAsync
|
||||
- name: javascript.options.experimental.enable_array_from_async
|
||||
type: bool
|
||||
value: true
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
#if defined(ENABLE_NEW_SET_METHODS)
|
||||
|
|
Загрузка…
Ссылка в новой задаче