-
Notifications
You must be signed in to change notification settings - Fork 60
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
brad4d Stage 3 Review feedback #364
Comments
How would one disallow extension? Everything that ES provides can be a superclass, afaik. |
@ljharb It seems to me that there are other globals that cause an exception if you try to use them in an extends clause. For example: C = class extends parseFloat {}; Generates this exception in Chrome:
I haven't yet tried to find which part of the spec specifies this behavior, but perhaps you already know? |
Ah, yes - functions without a .prototype. However, that wouldn’t make sense when there can be instances of both. |
One argument is consistency with other recently added types, |
I don't see a strong reason to push back on the extension bullet point. What about the |
Did you mean that |
@nicolo-ribaudo Yes, that's what I mean. https://tc39.es/proposal-record-tuple/#sec-tuple.prototype.concat See the loop in step 5.c.v. If an expected numeric index does not exist, nothing is appended to the tuple. |
Regarding extension, |
Edit: I just learned that "The … constructor … is not intended to be used with the new operator or to be subclassed." For others who may not understand the reason why. I do agree with @ljharb, sometimes consistency trumps reason. This should work, as it does in the playground:
|
For all of these questions I searched through the issues (including closed) and the main-page
README.md
to find an answer before asking here. If one of these answers is there somewhere, perhaps it could be made more prominent.class A extends Tuple {
at all?Tuple.prototype.concat(...args)
close up "holes" within the argument array-likes instead of filling in undefined values? This seems inconsistent with the behavior ofArray.prototype.concat(...args)
.I apologize for leaving this so late.
At least I didn't find much to comment on.
The text was updated successfully, but these errors were encountered: