Skip to content
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

[[TypedArrayConstructorName]] no longer needed #271

Closed
allenwb opened this issue Dec 21, 2015 · 1 comment
Closed

[[TypedArrayConstructorName]] no longer needed #271

allenwb opened this issue Dec 21, 2015 · 1 comment

Comments

@allenwb
Copy link
Member

allenwb commented Dec 21, 2015

The [[TypedArrayConstructorName]] internal slot of TypedArray constructors is no longer needed now that the secondary prototype walk has been eliminated by the changes made in the 2015-12-20 draft.

[[TypedArrayConstructorName]] was formally needed because each of the individual TypedArray constructors super called to %TypedArray% and that shared constructor algorithm needed a way to identify the element type of the instance being constructed.

However, with the recent changes, each TypedArray constructor is a distinct function. Hence, the desired element type can be literally coded within each constructor.

Here is sketch of the changes that need to be make:

  • In 22.2.4.1
  • add a new step after step 1: Let constructorName be the String value of the Constructor Name value specified in Table 50 for this TypedArray constructor.
  • Change the first argument of the call to AllocateTypedArray to be constructorName instead of TypedArray.[[TypedArrayConstructorName]].
  • Make similar changes in 22.2.4.2, 22.2.4.3, 22.2.4.5
  • In 22.2.5 delete the paragraph that defines the [[TypedArrayConstructorName]] internal slot.
@ljharb
Copy link
Member

ljharb commented Dec 21, 2015

No objections or concerns from me :-) but just in case, I wanted to point to my which-typed-array module whose behavior indirectly depends on the [[TypedArrayName]] internal slot of instances, which are currently populated via the [[TypedArrayConstructorName]] mechanism (and will remain correctly populated in each AllocateTypedArray call with @allenwb's suggested changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants