(Weak){Set|Map} subclassing

Allen Wirfs-Brock allen at wirfs-brock.com
Mon Dec 3 15:52:34 PST 2012


On Dec 3, 2012, at 3:03 PM, Jason Orendorff wrote:

> On Sat, Dec 1, 2012 at 2:38 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> The simplification I've thought about is eliminating [[Construct]] as an internal method/Proxy trap and just making the call @@Create/call consturctor sequence the evaluation semantics of the new operator.  But I've not yet convinced myself that this is sufficient to capture all of the "called as constructor"/"called as a function" semantic silliness that some chapter 15 built-ins have. I'm also not sure that DOM and friends don't have other dependencies on a reified [[Construt]]
> 
> The simplification I had in mind was changing [[Construct]] from an internal method/Proxy trap to an ordinary .@@construct method. There would be a @@construct/constructor split rather than a [[Construct]]/@@create/constructor split.
> 
> But on reflection, it didn't seem like that would be simpler in practice. Having two separately hookable phases of object construction is just right. A class can easily customize either behavior in a way that not only works, but will still work when the class is subclassed further.
> 
> -j

OK, so it sounds like we have a plan. I'll update the spec. to use @@create.

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121203/feefdf3e/attachment.html>


More information about the es-discuss mailing list