A strawman for subclassing

Allen Wirfs-Brock allen at wirfs-brock.com
Mon Jun 13 16:24:59 PDT 2011


On Jun 13, 2011, at 3:46 PM, David Bruant wrote:

> Hi,
> 
> The subclassing native constructor issue came out several times on the
> list and on the web. However, I do not see a strawman for this. There
> are strawman:array_create and strawman:array_subtypes, but no mention of
> a generic solution.

The <| operator is the proposed solution.

Using <|  instances with arbitrary [[Prototype]] values can be created for any type built-in object type that has a literal representation.  that is functions, arrays, regexps, and less interestingly, strings, numbers, booleans.  The resulting instance all have the appropriate special internal behaviors that are associated with the built-in types.

Allen



More information about the es-discuss mailing list