Normative: Remove Species check for TypedArrays ArrayBuffers and SharedArrayBuffers#3450
Draft
Normative: Remove Species check for TypedArrays ArrayBuffers and SharedArrayBuffers#3450
Conversation
baf349b to
9d5da42
Compare
9d5da42 to
77ad7fe
Compare
ljharb
reviewed
Oct 16, 2024
| 1. Throw a *TypeError* exception. | ||
| </emu-alg> | ||
| <emu-note> | ||
| <p>Species constructor is only available for Array, RegExp and Promise built-in classes. It |
Member
There was a problem hiding this comment.
Suggested change
| <p>Species constructor is only available for Array, RegExp and Promise built-in classes. It | |
| <p>Species constructor is only available for Array, RegExp, and Promise built-in classes. It |
Comment on lines
43795
to
43796
| 1. Let _ctor_ be %ArrayBuffer%. | ||
| 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). |
Member
There was a problem hiding this comment.
Suggested change
| 1. Let _ctor_ be %ArrayBuffer%. | |
| 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). | |
| 1. Let _new_ be ? Construct(%ArrayBuffer%, « 𝔽(_newLen_) »). |
Comment on lines
44113
to
44114
| 1. Let _ctor_ be %SharedArrayBuffer%. | ||
| 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). |
Member
There was a problem hiding this comment.
Suggested change
| 1. Let _ctor_ be %SharedArrayBuffer%. | |
| 1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). | |
| 1. Let _new_ be ? Construct(%SharedArrayBuffer%, « 𝔽(_newLen_) »). |
bakkot
reviewed
Oct 16, 2024
| <p>Species constructor is only available for Array, RegExp and Promise built-in classes. It | ||
| will not be provided to any other built-in classes. Species are an expensive and complex | ||
| operation that did not end up being used by the community, resulting in the feature being | ||
| deprecated.</p> |
Member
There was a problem hiding this comment.
Editors discussed this and we think that capturing "we aren't going to do this anymore" probably doesn't belong in the spec itself. Instead, how-we-work/normative-conventions.md would be a good place for capturing this for the committee's benefit, and MDN for the community's.
Contributor
Author
There was a problem hiding this comment.
Should this note be removed entirely or should the comment about species constructor availability stay?
| <dl class="header"> | ||
| <dt>description</dt> | ||
| <dd>It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike TypedArraySpeciesCreate, which can construct custom TypedArray subclasses through the use of %Symbol.species%, this operation always uses one of the built-in TypedArray constructors.</dd> | ||
| <dd>It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. This operation always uses one of the built-in TypedArray constructors.</dd> |
Member
There was a problem hiding this comment.
Suggested change
| <dd>It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. This operation always uses one of the built-in TypedArray constructors.</dd> | |
| <dd>It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. This operation always uses one of the built-in TypedArray constructors. Prior to the 2025 edition of the specification some TypedArray methods made use of SpeciesCreate, but that functionality has been removed.</dd> |
zloirock
added a commit
to zloirock/core-js
that referenced
this pull request
Oct 17, 2024
jmdyck
reviewed
Oct 19, 2024
| 1. Throw a *TypeError* exception. | ||
| </emu-alg> | ||
| <emu-note> | ||
| <p>Species constructor is only available for Array, RegExp, and Promise built-in classes. </p> |
Collaborator
There was a problem hiding this comment.
Suggested change
| <p>Species constructor is only available for Array, RegExp, and Promise built-in classes. </p> | |
| <p>Species constructor is only available for Array, RegExp, and Promise built-in classes.</p> |
bakkot
approved these changes
Oct 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a first stab at removing the Species check for TA, ABs, and SABs, in line with our review of the webcompat of it all: https://docs.google.com/presentation/d/1J0xct8EHUC90P6QpggISxuAp_5L_qaDa3SZ9gQaB0kA/edit#slide=id.p
There is a note in there about deprecating this behavior, but I wasn't 100% sure how to do that. Comments welcome.
cc @mgaudet