True. We have some special cases w.r.t. object literals, and I've thought about optimizing `__proto__:` in particular. There's no fundamental reason we couldn't do it, but so far the syntax does not seem to be common enough to pay for it.
-j On Mon, May 16, 2016 at 2:20 PM, Allen Wirfs-Brock <[email protected]> wrote: > >> On May 16, 2016, at 10:31 AM, Jason Orendorff <[email protected]> >> wrote: >> >> ... >> `B.prototype = Object.create(A.prototype)` is less of a problem, for >> our implementation, because objects created by constructor B later get >> a prototype chain where every object is clean (none of them have ever >> had their [[Prototype]] changed; so no assumptions have been >> invalidated). >> > > Jason, > > Do you or have you considered special casing __proto__ used in object > literals: > > ```js > > let p = { > __proto__: Array.prototype, > m1 () {…}, > m2 () {…} > }; > ``` > > Lots of good declarative shape information in that form. > > Allen > > _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

