@@new

Kevin Smith zenparsing at gmail.com
Thu Jun 19 05:08:56 PDT 2014


>
>
> I'd like to understand. Why doesn't it work?
>
>
Allen wondered the same, so I'll just paste my reply to him:

So I was a little embarrassed about not thinking it through, and wanted to
just void the comment.

But specifically, if the subclass wants to have a different set of
constructor arguments than its base class, then presumably the subclass
would have to override @@create with that signature.

class MyMap extends Map {
    constructor(a, b, c) { super(); /* other initialization */ }
    static [Symbol.create](a, b, c) { return super(); }
}

Is that right?

That seems like too much of a burden for the user.  And besides, it
pollutes the nice separation of responsibilities that we currently have.

The current design does posit uninitialized objects, which implementers are
obviously uncomfortable with.  Could it be that we just haven't yet
developed the implementation techniques for dealing with such uninitialized
objects? Or is there a real problem with being able to observe them?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140619/d6b6f302/attachment.html>


More information about the es-discuss mailing list