tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 436516d03af77f3b31edaa4733ad36490bf8561a
parent c3bbb8785ea008a8fb07bca7c9df812799eb9f74
Author: Daniel Minor <dminor@mozilla.com>
Date:   Thu, 13 Nov 2025 15:05:11 +0000

Bug 1986672 - Ship iterator sequencing; r=mgaudet

Differential Revision: https://phabricator.services.mozilla.com/D272316

Diffstat:
Mjs/src/builtin/Iterator.js | 2+-
Mjs/src/vm/Iteration.cpp | 2+-
Mjs/src/vm/JSObject.cpp | 8++++----
Mmodules/libpref/init/StaticPrefList.yaml | 14+++++++-------
4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/js/src/builtin/Iterator.js b/js/src/builtin/Iterator.js @@ -1014,7 +1014,6 @@ function IteratorFind(predicate) { } } -#ifdef NIGHTLY_BUILD /** * Iterator.concat ( ...items ) * @@ -1091,6 +1090,7 @@ function* IteratorConcatGenerator(iterables) { } } +#ifdef NIGHTLY_BUILD /** * Iterator.zip (iterables [, options]) * diff --git a/js/src/vm/Iteration.cpp b/js/src/vm/Iteration.cpp @@ -1912,8 +1912,8 @@ void js::AssertDenseElementsNotIterated(NativeObject* obj) { static const JSFunctionSpec iterator_static_methods[] = { JS_SELF_HOSTED_FN("from", "IteratorFrom", 1, 0), -#ifdef NIGHTLY_BUILD JS_SELF_HOSTED_FN("concat", "IteratorConcat", 0, 0), +#ifdef NIGHTLY_BUILD JS_SELF_HOSTED_FN("range", "IteratorRange", 3, 0), JS_SELF_HOSTED_FN("zip", "IteratorZip", 2, 0), JS_SELF_HOSTED_FN("zipKeyed", "IteratorZipKeyed", 2, 0), diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp @@ -2202,6 +2202,10 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx, id == NameToId(cx->names().isError)) { return true; } + if (!JS::Prefs::experimental_iterator_sequencing() && + id == NameToId(cx->names().concat)) { + return true; + } } #ifdef JS_HAS_INTL_API @@ -2225,10 +2229,6 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx, id == NameToId(cx->names().zipKeyed))) { return true; } - if (!JS::Prefs::experimental_iterator_sequencing() && - id == NameToId(cx->names().concat)) { - return true; - } } if (key == JSProto_Map || key == JSProto_WeakMap) { if (!JS::Prefs::experimental_upsert() && diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml @@ -8978,6 +8978,13 @@ mirror: always set_spidermonkey_pref: startup + # Experimental support for Iterator Sequencing in JavaScript. +- name: javascript.options.experimental.iterator_sequencing + type: bool + value: true + mirror: always + set_spidermonkey_pref: startup + #ifdef NIGHTLY_BUILD # Experimental support for Async Iterator Helpers in JavaScript. - name: javascript.options.experimental.async_iterator_helpers @@ -9000,13 +9007,6 @@ mirror: always set_spidermonkey_pref: startup - # Experimental support for Iterator Sequencing in JavaScript. -- name: javascript.options.experimental.iterator_sequencing - type: bool - value: false - mirror: always - set_spidermonkey_pref: startup - # Experimental support for immutable ArrayBuffers in JavaScript. - name: javascript.options.experimental.arraybuffer_immutable type: bool