commit fb271dc7a2917f66e2ceb0a99a7e001aa0a3cd24
parent c2024682693afe4ee8754342bb2fb36aab387e89
Author: Will Medina <williams.medinaa@gmail.com>
Date: Mon, 8 Dec 2025 19:53:57 +0000
Bug 2003345 - Add placeholder for Iterator.prototype.join. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D274844
Diffstat:
4 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/js/src/builtin/Iterator.js b/js/src/builtin/Iterator.js
@@ -1940,4 +1940,13 @@ function IteratorChunks(chunkSize) {
function IteratorWindows(windowSize, undersized) {
return false;
}
+
+/**
+ * Iterator.prototype.join ( separator )
+ *
+ * https://tc39.es/proposal-iterator-join/#sec-iterator.prototype.join
+ */
+function IteratorJoin(separator) {
+ return false;
+}
#endif
diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h
@@ -284,6 +284,7 @@
MACRO_(IteratorClose, "IteratorClose") \
MACRO_(Iterator_Helper_, "Iterator Helper") \
MACRO_(IteratorNext, "IteratorNext") \
+ MACRO_(join, "join") \
MACRO2(js, "js") \
MACRO_(jsTag, "JSTag") \
MACRO_(jsStringModule, "js-string") \
diff --git a/js/src/vm/Iteration.cpp b/js/src/vm/Iteration.cpp
@@ -1982,6 +1982,7 @@ static const JSFunctionSpec iterator_methods[] = {
#ifdef NIGHTLY_BUILD
JS_SELF_HOSTED_FN("chunks", "IteratorChunks", 1, 0),
JS_SELF_HOSTED_FN("windows", "IteratorWindows", 2, 0),
+ JS_SELF_HOSTED_FN("join", "IteratorJoin", 1, 0),
#endif
JS_FS_END,
};
diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp
@@ -2251,6 +2251,11 @@ JS_PUBLIC_API bool js::ShouldIgnorePropertyDefinition(JSContext* cx,
return true;
}
}
+ if (key == JSProto_Iterator && !JS::Prefs::experimental_iterator_join()) {
+ if (id == NameToId(cx->names().join)) {
+ return true;
+ }
+ }
#endif
if (key == JSProto_Function &&