-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add species note to normative conventions #157
base: main
Are you sure you want to change the base?
Conversation
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. Array, Promise, and RegExp were not web compatible to change. No other builtins were using it at the time of update. |
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## New Builtins should not make use of @@species | |
## New Builtins should not make use of `Symbol.species` |
|
||
## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
See: tc39/ecma262#3450
Wasn't sure how much detail we wanted here.