On Oct 13, 2011, at 3:55 PM, John J Barton wrote: > > Suppose for a moment we allowed objects on the RHS: > var o3 = p <| o2; > Would we imagine that o2 was mutated in any way? I don't think so. Maybe > there are binary ops that mutate operands, but they don't come to mind. So > the entire business about mutation of [[ProtoLink]] is not related to my > interest in allowing object expressions on the RHS of protoLinkSet operator.
Note that my original thoughts that lead to <| included the possibility that the RHS could be an arbitrary expression. In order to avoid [[Prototype]] mutation that meant that the RHS would have to be shallow cloned to produce a new object whose [[Prototype]] was the LHS value. The semantics of cloning is not as trivial as somebody seems to assume and the primary use case I was trying to address ("subclass" Arrays , Functions, and other objects with special implementation level behaviors) didn't require it. So it punted and specified that the RHS must be a literal. This left open the possibility that at some future date we might want to reconsider that restriction. I still haven't found a really compelling use case for a non-literal <| RHS and a good definition for object cloning is still a nut to crack. But both plausibly might occur. Allen _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss