Alice wouldn't normally be able to communicate 'bound' to Bob, and thus Bob wouldn't be able to read Alice's 'bound.foo'. The issue is much like ES3's mistake of evaluation a RegExp literal once to a RegExp object -- everyone executing the same code could now communicate, even if all accessible primordial state were frozen.
The answer to both is the same -- the immutable objects they share can only return mutable objects if these objects are fresh. Alice and Bob can then separately mutate them without being able to observe each other's mutations. This is why it is essential that .bind() return a fresh object each time it is called. On Fri, Jan 6, 2012 at 12:58 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > same thing this does > > var bound = Object.bind(Object); > bound.foo = capabilityBobShouldntGet; // who does this ? > > var HAH = bound.foo; > > ... so I am missing your point I guess ... but my proposal wants to return > always same object for 99.9% of usage out there ... > > > On Fri, Jan 6, 2012 at 8:55 AM, Mark S. Miller <erig...@google.com> wrote: > >> In your proposal, what does this code sequence do: >> >> >> Object.boundTo(Object).foo = capabilityBobShouldntGet; >> var HAH = Object.boundTo(Object).foo; >> >> ? >> >> > -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss