-
Notifications
You must be signed in to change notification settings - Fork 113
Class private fields can't be used with extends null
#288
Comments
This is a result of classes themselves not properly supporting null. You can, however, extend a class that extends null and uses your workaround. |
What's the glitch in the |
The issue is that a constructor that extends This is being fixed in issue tc39/ecma262#1036 (PR: tc39/ecma262#1321). |
I get it. Now just out of curiosity, why was |
Just thought about it. That's questions better targeted on es-discuss... |
Yeah, classes extending null is sort of generally broken, unfortunately. See tc39/ecma262#1321 for some further discussion. Closing this issue, as it's not about class fields. |
With public fields, you can at least do:
But with private fields, you can’t use the
Object.create
work‑around.It’d be so much easier if:
and
didn’t throw.
That would allow class fields to also be used with
extends null
:The text was updated successfully, but these errors were encountered: