On Thu, Jun 12, 2014 at 3:21 PM, Allen Wirfs-Brock <al...@wirfs-brock.com> wrote: > It's not obvious to me why we would need @@new in addition to @@create (which > is pretty much equivalent to saying it's not clear to me why we need > [[Construct]]). For the ordinary case, @@new would just be another level of > method lookup and invocation that would be required on each new. While we > expect implementations to (eventually) optimize all of this, we still tried > to minimize the amount of boiler plate work required for each new.
>From my perspective, it's about simplifying the language. I like the fact that 'new C' is "just" sugar for an ordinary method invocation on C. It would simplify the presentation of the spec as well: various places that currently state special behavior for "new XYZ" forms could instead describe the ordinary method XYZ.@@new. And as Jason points out, this conceptual simplification of the language translates into concrete API simplifications for reflective operations like Proxies. I don't think there are any special security issues involved, since I can already do: `let x = Reflect.construct.bind(Reflect, C)` and pass that around. --scott (fwiw, Crockford's "Simplified JavaScript" in http://javascript.crockford.com/tdop/tdop.html and my own "TurtleScript" subset of JavaScript in https://github.com/cscott/TurtleScript both did away with the new operator. TurtleScript replaced it with `Function#New`.) _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss