new instantiation design alternatives

Erik Arvidsson erik.arvidsson at gmail.com
Wed Sep 17 10:50:38 PDT 2014


I still feel like Kevin's point has not yet been resolved. How can we make
this work with today's patterns?

import {C} from './C.js';

function D() {
  C.call(this);
}
D.prototype = {
  __proto__: C.prototype,
  constructor: D,
  ...
}

Now assume that C.js initially used the ES5 pattern above and it was later
changed to use class syntax using `this =`.

class C extends B {
  constructor() {
    this = new super();
  }
}

Since we are doing a C[[Call]] we will get a runtime error here.

With @@create we could mix and match the two different forms.

On Wed, Sep 17, 2014 at 1:39 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Allen Wirfs-Brock wrote:
>
>> actually I did respond:
>>
>
> Sorry, missed that message somehow. Sold!
>
>
> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140917/e6e9ef7e/attachment.html>


More information about the es-discuss mailing list