-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Normative: Remove Species check for TypedArrays ArrayBuffers and SharedArrayBuffers #3450
base: main
Are you sure you want to change the base?
Conversation
baf349b
to
9d5da42
Compare
9d5da42
to
77ad7fe
Compare
@@ -6572,6 +6572,12 @@ <h1> | |||
1. If IsConstructor(_S_) is *true*, return _S_. | |||
1. Throw a *TypeError* exception. | |||
</emu-alg> | |||
<emu-note> | |||
<p>Species constructor is only available for Array, RegExp and Promise built-in classes. It |
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.
<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 |
spec.html
Outdated
1. Let _ctor_ be %ArrayBuffer%. | ||
1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). |
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.
1. Let _ctor_ be %ArrayBuffer%. | |
1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). | |
1. Let _new_ be ? Construct(%ArrayBuffer%, « 𝔽(_newLen_) »). |
spec.html
Outdated
1. Let _ctor_ be %SharedArrayBuffer%. | ||
1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). |
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.
1. Let _ctor_ be %SharedArrayBuffer%. | |
1. Let _new_ be ? Construct(_ctor_, « 𝔽(_newLen_) »). | |
1. Let _new_ be ? Construct(%SharedArrayBuffer%, « 𝔽(_newLen_) »). |
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.
We should also update Annex F.
Looks good other than my comments.
<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> |
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.
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.
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.
Should this note be removed entirely or should the comment about species constructor availability stay?
@@ -41517,7 +41502,7 @@ <h1> | |||
</h1> | |||
<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> |
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.
<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> |
@@ -6572,6 +6572,9 @@ <h1> | |||
1. If IsConstructor(_S_) is *true*, return _S_. | |||
1. Throw a *TypeError* exception. | |||
</emu-alg> | |||
<emu-note> | |||
<p>Species constructor is only available for Array, RegExp, and Promise built-in classes. </p> |
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.
<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> |
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