On Tue, Jun 17, 2014 at 6:55 PM, Erik Arvidsson
<erik.arvids...@gmail.com> wrote:
> How does this work with legacy classes?
>
> function B() {
>   this.x = 1;
> }
> class C extends B {}

That works!

`new C` desugars to `C[@@new]()`.  C doesn't have a @@new method of
its own, so it inherits `Function.prototype[@@new]`.

The algorithm for that method is given in the proposal. Step 1 selects
the right prototype here (C.prototype), and step 4 calls B as desired.

-j
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to