Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up%TypedArray% constructor calling super #305
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Jan 21, 2016
Member
Seems like a typo in my PR that the TypedArray constructors don't call the super constructor. As for the %TypedArray% constructor, calling the super constructor was a suggestion by @allenwb , but I think you're right--this isn't needed, as %TypedArray% is a base class, and base classes don't tend to call their super constructor (even if one is dynamically added through proto chain manipulation).
|
Seems like a typo in my PR that the TypedArray constructors don't call the super constructor. As for the %TypedArray% constructor, calling the super constructor was a suggestion by @allenwb , but I think you're right--this isn't needed, as %TypedArray% is a base class, and base classes don't tend to call their super constructor (even if one is dynamically added through proto chain manipulation). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
allenwb
Jan 22, 2016
Member
See what I said in #163 (comment) and #163 (comment) .
%TypedArray% should throw if directly newed, super called, or called. It should just throw a TypeError
|
See what I said in #163 (comment) and #163 (comment) . %TypedArray% should throw if directly newed, super called, or called. It should just throw a TypeError |
added a commit
to littledan/ecma262
that referenced
this issue
Jan 22, 2016
added a commit
to littledan/ecma262
that referenced
this issue
Jan 22, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Jan 22, 2016
Member
@allenwb I really like this idea. Wrote a PR to implement it. What do you think?
|
@allenwb I really like this idea. Wrote a PR to implement it. What do you think? |
added a commit
to leobalter/ecma262
that referenced
this issue
Jan 22, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@littledan I came in 5 minutes late: 9c10da5 :) |
leobalter commentedJan 21, 2016
Previously on the ES2015, we got each of the TypedArray constructors calling the %TypedArray% super class:
Now (on the ES2016 draft/master branch) the TypedArray constructors are not calling the %TypedArray% superclass anymore. See #163 (comment)
And a super call is now seen at the %TypedArray% constructor:
It seems the the steps 4 and 5 are misplaced. They came from #247, it seems they might be removed or doesn't need to be placed there.
Checking %TypedArray% static methods as
fromandof, both call TypedArrayCreate which is safe when called from the TypedArray objects and won't need no further call on super as well.It seems safe to say %TypedArray% might throw a TypeError on any way it's called. It does not help creating internals neither it seems necessary on the static methods.