{this} object literal
Gary Guo
xg244 at cam.ac.uk
Fri Apr 21 18:16:41 UTC 2017
Because the shorthand requires an Identifer, and an IdentiferName is not sufficient. If the rule allows arbitrary IdentiferName, then we will also allow `{if}`, which makes no sense it all. So if we really want to allow this, it would be a special rule in addition to the current rule. In this sense, we are not forbidden the use of `{this}`, but instead we don't have the rule to allow that.
________________________________
From: es-discuss <es-discuss-bounces at mozilla.org> on behalf of Michał Wadas <michalwadas at gmail.com>
Sent: Friday, April 21, 2017 6:01:37 PM
To: es-discuss at mozilla.org
Subject: {this} object literal
Hi.
Is there any specific reason why {this} literal is forbidden? Babel had a bug allowing this and it was pretty convenient to enter console.log({this, arguments, externalVar}) for quick printing scope.
Michał Wadas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170421/b098e8b8/attachment.html>
More information about the es-discuss
mailing list