Computed Property Name Shorthand Proposal

Kevin Smith zenparsing at gmail.com
Thu Aug 27 16:25:37 UTC 2015


>
> I'd expect the following to work, given that the prop expression evaluates
> to 'bar', and bar is in context.
>
> var foo = 'bar'
> var bar = 'ponyfoo'
> var baz = { [foo] }
> console.log(baz)
> // <- { bar: 'ponyfoo' }
>

Hmmm...  I'm not sure I would expect any such thing.  It seems like you're
proposing some kind of dynamic eval-ish variable binding lookup, which is
probably going to be a no-go.

Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150827/abd14681/attachment.html>


More information about the es-discuss mailing list