Names strawman ready for discussion

Sam Tobin-Hochstadt samth at ccs.neu.edu
Tue Sep 7 18:57:00 PDT 2010


On Wed, Sep 8, 2010 at 2:47 AM, Mark S. Miller <erights at google.com> wrote:
> On Tue, Sep 7, 2010 at 4:17 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu>
> wrote:
>>
>> I've significantly revised the private names strawman, available here:
>>
>>  http://wiki.ecmascript.org/doku.php?id=strawman:names
>>
>> Feedback is welcome, especially on the semantics discussion, which I
>> hope is clearer at this point.
>>
>> Thanks to Dave and Allen for their feedback.  This is also planned for
>> discussion at the next TC39 meeting.
>
> Hi Sam, glad to see this coming together. A couple questions:
> 1) Given
>     const n = new Name();
>     const x = Object.freeze({...});
> what does
>     x[n] = 88;
> do?

Produces an error, just as x["n"] would.

> 2) Given
>     const n = new Name();
>     const x = Proxy.create(..., ...);
> what does
>     x[n] = 88;
> do?

Calls the 'set' trap of 'x' with x, n, and 88 as arguments.
-- 
sam th
samth at ccs.neu.edu


More information about the es-discuss mailing list