commit c2024682693afe4ee8754342bb2fb36aab387e89
parent 620b9a6634addf13e2fbb3823f4477c13ec55ef6
Author: Will Medina <williams.medinaa@gmail.com>
Date: Mon, 8 Dec 2025 19:53:56 +0000
Bug 2003345 - Add Iterator.join preference. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D274843
Diffstat:
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
@@ -13322,7 +13322,8 @@ bool InitOptionParser(OptionParser& op) {
!op.addBoolOption('\0', "enable-arraybuffer-immutable",
"Enable immutable ArrayBuffers") ||
!op.addBoolOption('\0', "enable-iterator-chunking",
- "Enable Iterator Chunking")) {
+ "Enable Iterator Chunking") ||
+ !op.addBoolOption('\0', "enable-iterator-join", "Enable Iterator.join")) {
return false;
}
@@ -13404,6 +13405,9 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) {
if (op.getBoolOption("enable-iterator-chunking")) {
JS::Prefs::setAtStartup_experimental_iterator_chunking(true);
}
+ if (op.getBoolOption("enable-iterator-join")) {
+ JS::Prefs::setAtStartup_experimental_iterator_join(true);
+ }
#endif
#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT
if (op.getBoolOption("enable-explicit-resource-management")) {
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
@@ -9057,6 +9057,13 @@
mirror: always
set_spidermonkey_pref: startup
+ # Experimental support for Iterator.join in JavaScript.
+- name: javascript.options.experimental.iterator_join
+ type: bool
+ value: false
+ mirror: always
+ set_spidermonkey_pref: startup
+
#endif // NIGHTLY_BUILD
# Whether to Baseline-compile self-hosted functions the first time they are