tor-browser

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

commit 8fdfc533f6880bfc7044d3367aac68368899346d
parent c25a9485ce985c6d4fc75be1c3957736ec076657
Author: Daniel Minor <dminor@mozilla.com>
Date:   Thu, 11 Dec 2025 14:31:10 +0000

Bug 2003333 - Ship joint iteration; r=mgaudet

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

Diffstat:
Mjs/src/shell/js.cpp | 6+++---
Mjs/src/vm/Iteration.cpp | 2+-
Mjs/src/vm/JSObject.cpp | 10+++++-----
Mmodules/libpref/init/StaticPrefList.yaml | 24++++++++++++------------
4 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp @@ -13419,6 +13419,9 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) { } JS::Prefs::setAtStartup_experimental_symbols_as_weakmap_keys( symbolsAsWeakMapKeys); + if (op.getBoolOption("enable-joint-iteration")) { + JS::Prefs::setAtStartup_experimental_joint_iteration(true); + } #ifdef NIGHTLY_BUILD if (op.getBoolOption("enable-async-iterator-helpers")) { @@ -13430,9 +13433,6 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) { if (op.getBoolOption("enable-iterator-range")) { JS::Prefs::setAtStartup_experimental_iterator_range(true); } - if (op.getBoolOption("enable-joint-iteration")) { - JS::Prefs::setAtStartup_experimental_joint_iteration(true); - } if (op.getBoolOption("enable-upsert")) { JS::Prefs::setAtStartup_experimental_upsert(true); } diff --git a/js/src/vm/Iteration.cpp b/js/src/vm/Iteration.cpp @@ -1955,9 +1955,9 @@ static const JSFunctionSpec iterator_static_methods[] = { JS_SELF_HOSTED_FN("concat", "IteratorConcat", 0, 0), #ifdef NIGHTLY_BUILD JS_SELF_HOSTED_FN("range", "IteratorRange", 3, 0), +#endif JS_SELF_HOSTED_FN("zip", "IteratorZip", 2, 0), JS_SELF_HOSTED_FN("zipKeyed", "IteratorZipKeyed", 2, 0), -#endif JS_FS_END, }; diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp @@ -2206,6 +2206,11 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx, id == NameToId(cx->names().concat)) { return true; } + if (!JS::Prefs::experimental_joint_iteration() && + (id == NameToId(cx->names().zip) || + id == NameToId(cx->names().zipKeyed))) { + return true; + } } #ifdef JS_HAS_INTL_API @@ -2224,11 +2229,6 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx, (id == NameToId(cx->names().range))) { return true; } - if (!JS::Prefs::experimental_joint_iteration() && - (id == NameToId(cx->names().zip) || - id == NameToId(cx->names().zipKeyed))) { - 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 @@ -9017,11 +9017,18 @@ 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 +- name: javascript.options.experimental.iterator_sequencing + type: bool + value: true + mirror: always + set_spidermonkey_pref: startup + + # Experimental support for Joint Iteration in JavaScript. +- name: javascript.options.experimental.joint_iteration + type: bool + value: true + mirror: always + set_spidermonkey_pref: startup #ifdef NIGHTLY_BUILD # Experimental support for Async Iterator Helpers in JavaScript. @@ -9038,13 +9045,6 @@ mirror: always set_spidermonkey_pref: startup - # Experimental support for Joint Iteration in JavaScript. -- name: javascript.options.experimental.joint_iteration - 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