Oh, for sure: I was not advocating a change in actual ES6. I was just explaining on Scott's behalf how it was possible to have subclassable polyfills before implementing @@create.
Implementations could, in theory, implement subclassable promises before implementing @@create, via similar semantics. That is, they can choose between being standards non-compliant in one of two ways: 1. Non-subclassable, because no @@create. 2. Over-subclassable, because they allow parasitic inheritance. Eventually they will go for 3, just-plain-subclassable, once @@create is ready. But the question is what they want to do in the meantime. ________________________________ From: Mark S. Miller <[email protected]> Sent: Tuesday, February 18, 2014 14:16 To: Domenic Denicola Cc: Allen Wirfs-Brock; C. Scott Ananian; Brendan Eich; Yutaka Hirano; [email protected] list Subject: Re: Promise.cast and Promise.resolve The same rationale would apply to Date, but making this change for Date would be a breaking change. For consistency, let's not pick and choose among builtins this way. We'll have @@create soon enough. On Tue, Feb 18, 2014 at 11:09 AM, Domenic Denicola <[email protected]<mailto:[email protected]>> wrote: From: Allen Wirfs-Brock <[email protected]<mailto:[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. -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

