In JavaScript it is possible to do:
var a = {this: this}
but with ES6 property shorthand I get SyntaxError:
var b = {this}; // SyntaxError: this is a reserved identifier
This is not a real use case but I am just wondering what is the difference between these two. I thought it should do the same (either create a new object or throw an error).
UPDATE:
I run this example in Firefox 42.0. However it works in babel-node (it creates object { this: {} }
without error). So what's the correct behavior?