From 033fad441a758c9e4b39edb173d7f4ebd71ae12b Mon Sep 17 00:00:00 2001 From: Yulia Startsev Date: Thu, 17 Oct 2024 11:09:02 +0200 Subject: [PATCH 1/3] Add species note to normative conventions --- normative-conventions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/normative-conventions.md b/normative-conventions.md index eae6781..536115f 100644 --- a/normative-conventions.md +++ b/normative-conventions.md @@ -45,3 +45,9 @@ Any time an iterable or async-iterable value (a value that has a `Symbol.iterato Although primitive Strings are default iterable (`String.prototype` has a `Symbol.iterator` method which enumerates code points), it is now considered a mistake to iterate a String without specifying whether the String is providing an abstraction over code units, code points, grapheme clusters, or something else. NB: This convention is new as of 2024, and most earlier parts of the language do not follow it. In particular, positional destructuring (both binding and assignment), array spread, argument spread, for-of loops, `yield *`, the `Set` and `AggregateError` constructors, `Object.groupBy`, `Map.groupBy`, `Promise.all`, `Promise.allSettled`, `Promise.any`, `Promise.race`, `Array.from`, the static `from` methods on typed array constructors, and `Iterator.from` (Stage 3 at time of writing) all accept primitives where iterables are expected. + +## New Builtins should not make use of @@species + +New Builtins, and any existing builtins that do not currently support @@species constructors should not be updated to support extensions via @@species. The @@species symbol can be made available but should not be referenced elsewhere. + +NB: This convention is new as of 2025, TypedArray, SharedArrayBuffer, and ArrayBuffer have been updated to follow it. Array, Promise, and RegExp were not web compatible to change. No other builtins were using it at the time of update. From 9c0416619094ae3c01e5860a9e82cd1995051339 Mon Sep 17 00:00:00 2001 From: yulia Date: Wed, 23 Oct 2024 17:24:15 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Michael Ficarra --- normative-conventions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/normative-conventions.md b/normative-conventions.md index 536115f..34d4185 100644 --- a/normative-conventions.md +++ b/normative-conventions.md @@ -46,8 +46,8 @@ Although primitive Strings are default iterable (`String.prototype` has a `Symbo NB: This convention is new as of 2024, and most earlier parts of the language do not follow it. In particular, positional destructuring (both binding and assignment), array spread, argument spread, for-of loops, `yield *`, the `Set` and `AggregateError` constructors, `Object.groupBy`, `Map.groupBy`, `Promise.all`, `Promise.allSettled`, `Promise.any`, `Promise.race`, `Array.from`, the static `from` methods on typed array constructors, and `Iterator.from` (Stage 3 at time of writing) all accept primitives where iterables are expected. -## New Builtins should not make use of @@species +## New Builtins should not make use of `Symbol.species` -New Builtins, and any existing builtins that do not currently support @@species constructors should not be updated to support extensions via @@species. The @@species symbol can be made available but should not be referenced elsewhere. +New Builtins, and any existing builtins that do not currently support `Symbol.species` constructors should not be updated to support extensions via `Symbol.species`. The `Symbol.species` symbol can be made available but should not be referenced elsewhere. -NB: This convention is new as of 2025, TypedArray, SharedArrayBuffer, and ArrayBuffer have been updated to follow it. Array, Promise, and RegExp were not web compatible to change. No other builtins were using it at the time of update. +NB: This convention is new as of 2025, TypedArray, SharedArrayBuffer, and ArrayBuffer have been updated to follow it. Although we would want this change to also apply to Array, Promise, and RegExp, that change was found to not be web compatible. No other builtins were using it at the time of update. From 526f990dbe02f3bf0e6c1d8d0b39673e012f5f45 Mon Sep 17 00:00:00 2001 From: Yulia Startsev Date: Wed, 23 Oct 2024 17:27:19 +0200 Subject: [PATCH 3/3] add missed semicolon --- normative-conventions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/normative-conventions.md b/normative-conventions.md index 34d4185..bd640ad 100644 --- a/normative-conventions.md +++ b/normative-conventions.md @@ -50,4 +50,4 @@ NB: This convention is new as of 2024, and most earlier parts of the language do New Builtins, and any existing builtins that do not currently support `Symbol.species` constructors should not be updated to support extensions via `Symbol.species`. The `Symbol.species` symbol can be made available but should not be referenced elsewhere. -NB: This convention is new as of 2025, TypedArray, SharedArrayBuffer, and ArrayBuffer have been updated to follow it. Although we would want this change to also apply to Array, Promise, and RegExp, that change was found to not be web compatible. No other builtins were using it at the time of update. +NB: This convention is new as of 2025; TypedArray, SharedArrayBuffer, and ArrayBuffer have been updated to follow it. Although we would want this change to also apply to Array, Promise, and RegExp, that change was found to not be web compatible. No other builtins were using it at the time of update.