Intent to ship: ES6 classes

540 views
Skip to first unread message

Dmitry Lomov

unread,
Dec 15, 2014, 9:01:57 AM12/15/14
to v8-users, blink-dev
[blink-dev: FYI]
Classes syntax are part of ES6. The spec in Editor's draft is stable.

IE has classes in preview release [1]. No other browser currently ships classes (Mozilla bug [2]).

V8 implementation of classes is up-to-date with the latest ES6 spec modulo the limitations noted below.


Limitations:

- Classes are dependent on lexical declarations. Since the latter are currently only supported in strict mode, we currently only support classes in strict mode as well.
- At this time we do not support subclassing built-ins and DOM objects
- Current ES6 specification (in particular, [[CreateAction]] hook that takes arguments) makes design of subclassable exotic (in particular DOM) objects unclear. We intend to work with involved parties on resolving this difficulty, but for now we add an extra limitation to calls to super constructor in subclasses: if a subclass constructor calls a superclass constructor via ‘super(...)’ call, that call must be the first statement of constructor’s body, and arguments to ‘super(...)’ call can not refer to ‘this’. 
We intend to lift this restriction in the future, once we clarify the design for exotic objects’ subclassing.




--
Google Germany GmbH
Dienerstr. 12, 80331 München., DE 
Reply all
Reply to author
Forward
0 new messages