ariya/esprima — pull request #266 by toshok (2014-06-19 21:18:45+00:00)
Title: add support for computed properties in object initializers and class declarations

Hey Ariya. Not sure this PR is ready for prime time but wanted to get your thoughts on the change. It definitely works for the following ejs tests:

```js
var x = 'y';
console.log (({ [x]: 1 })['y'] === 1); // prints true
```

and the more complicated:
```js
class Foo {
get [Symbol.toStringTag]() {
return "Foo";
}
[Symbol.iterator]() {
console.log("i should return an iterator");
return [1,2,3][Symbol.iterator]();
}
}

var f = new Foo();
console.log(Object.prototype.toString.call(f));

for (var x of f) {
console.log(x);
}
```

which outputs:
```
[object Foo]
i should return an iterator
1
2
3
```