Harmony object literals

Allen Wirfs-Brock allen at wirfs-brock.com
Mon Jun 6 10:32:17 PDT 2011


On Jun 6, 2011, at 9:38 AM, Kam Kasravi wrote:

> I see, the object's prototype is to the left of <| and the actual object is to the right. I guess that was made clear in the proposal though I suspect others will invert the relationship since javascript programmers are used to defining the prototype after defining the object. The <| operator seems like you're piping something into a target rather than the other way around, you know like the shell < operator. Thanks for the clarifications.
> 

The primary reason is that the actual object must be a literal form and if the order was reversed the <|  (or perhaps |>) and prototype value would be visually lost at the end of a long literal.  It's too important to come at the end.


var myObject = {
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     //a page of property definitions...
     } |> myProto;

Allen


More information about the es-discuss mailing list