Domenic Denicola wrote:
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.
This is precisely the contentious issue, though. Should implementations be constrained to make Promises be "normal objects with some internal slots initialized"? If you subclass, you need the super's @@create to allocate the correctly shaped object, never mind setting the internal slots to default (undefined or nominal) values.
Self-hosting a shim is nice, but it can overspecify. ES6 promises are not specified as self-hosted. Internal slots plus subclassability requires @@create.
/be _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss