On Nov 17, 2011, at 2:15 PM, Brendan Eich wrote:
> On Nov 17, 2011, at 2:08 PM, David Herman wrote:
>
>>> Prototype extension or delegation is not the same as FRU at all -- the
>>> delegating object can shadow proto-properties,
>>
>> That's precisely what makes it analogous to FRU. You functionally update
>> (i.e., update without mutating) by shadowing.
>
> Mutating [[Prototype]] is still mutation :-P.
>
> The fact that you get a chain of two or more objects instead of one is the
> big thing about this that makes it not FRU to me. We don't have records, of
> course, but squinting hard at objects might make them look as pretty (need
> beer goggles ;-). But only own properties of a single object, so I'd want FRU
> of this kind:
>
> let o = { p:1, r:3 };
> let u = { o where p:1, q:2 };
>
> and u would have own p, q, and r.
And *the punchline* -- mutating o.p = 4 would not change u.p. With your
Object.create scheme, unless you freeze (could do for record-ness), you get
unwanted sharing if there are references out there to the un-updated
record-object.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss