ariya/esprima — pull request #265 by DmitrySoshnikov (2014-06-14 06:49:03+00:00)
Title: [ES6] Computed properties

Per ES6 spec [1], Object Initializers may have computed properties.

Grammar:

```
ComputedPropertyName[Yield] :
[ AssignmentExpression[In, ?Yield] ]
```

Examples:

```
var x = 'y';
var foo = {[x]: 10};
console.log(foo); // {y: 10}
```

More complex `AssignmentExpression`:

```
var y = 'y';
({['x' + y]}).xy; // 10
```

Methods and accessors:

```
var foo = {
[dynamicMethodName]: function() {},
[conciseMethod]() {},
*[generatorName]() {},
get [foo]() {},
set [foo](v) {}
};
```

In destructuring assignment:

```
var x = 'y';
var {[x]: y} = {y: 10};
console.log(y); // 10
```

Issue #480: https://code.google.com/p/esprima/issues/detail?id=480

[1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-initializer