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@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 

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

Reply via email to