From: Allen Wirfs-Brock <[email protected]>

> 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.

Well, but you could just move the internal slot initialization into the 
constructor itself (as Scott has done in his es6-shim promises). Unlike e.g. 
`Array`, the objects returned by `Promise[@@create]` are not exotic objects; 
they are simply normal objects with some internal slots initialized. So the 
movement of code between `@@create` and the constructor does not impact very 
much.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to