On Fri, Jun 13, 2014 at 5:33 AM, Tom Van Cutsem <tomvc...@gmail.com> wrote:
> Interesting. It'd be nice if we could further simplify the Proxy/Reflect
> API. Given the local nature of these changes, we might still include it in
> ES6 if we achieve quick consensus.

I'm mostly interested in getting rid of [[Construct]]. Three cheers for that!

I like @@new better than @@create for three reasons:

1. I think it wins on common sense over @@create. "What's this
Symbol.new thing in this class?" "Oh, whenever you see `new X()`,
that's shorthand for the @@new method." Pretty straightforward.

2. I guess the purpose of @@create, to my mind, was to provide some
invariants: in particular, an object, once visible to script, is never
observed to "become" an Array object or "stop being" an Array object.
Its initialization is hidden in that method. But @@new does that just
as well or better, it seems to me. "Better" because, well, read on.

3. I'm uncomfortable with how all the constructor functions in ES5
have been rewritten in ES6 to have strange this-value checks and "has
this value already been initialized? if so, throw" checks.
Rarely-taken branches are bad for us --- it's a lot of tricky code
implementers will have to write, test, and optimize, for something
that should never happen. Providing @@new methods corresponding to the
ES5 [[Construct]] methods seems more to the point, clearer to specify,
and easier to implement.

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

Reply via email to