Allen Wirfs-Brock (2014-02-18T18:54:41.000Z)
On Feb 18, 2014, at 10:39 AM, Domenic Denicola wrote:

> You can do so in the manner you were always able to in ES5, and you were able to do in ES6 before the introduction of @@create. However, what this means is that you now allow parastic inheritance again, which @@create was created to disallow.
> 
> That is, you could have a MapPromiseWeakMap just by doing
> 
> ```js
> var obj = {};
> Map.call(obj);
> Promise.call(obj, function () {});
> WeakMap.call(obj);
> ```
> 
> So such a "solution" isn't really maintaining the ES6 semantics, since it allows strictly more things than ES6 does.   

No, even if you removed the checks in Map and Promise and WeakMap that prevent them from trying to initialize an object that lacks the appropriate internal slots it still wouldn't work because obj does not have the internal slots necessary to support the built-in operations upon those objects and implementations commonly implement such objects in a manner that prevents the dynamic addition of such slots.

The whole purpose of @@create is to allow implementations to allocate prior to invoking a constructor the correctly shaped object for built-ins.

Allen






> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
domenic at domenicdenicola.com (2014-02-24T21:07:49.279Z)
No, even if you removed the checks in Map and Promise and WeakMap that prevent them from trying to initialize an object that lacks the appropriate internal slots it still wouldn't work because obj does not have the internal slots necessary to support the built-in operations upon those objects and implementations commonly implement such objects in a manner that prevents the dynamic addition of such slots.

The whole purpose of @@create is to allow implementations to allocate prior to invoking a constructor the correctly shaped object for built-ins.