ariya/esprima — pull request #286 by fkling (2014-09-26 00:32:09+00:00)
Title: Remove/fix duplicate class method check

[Rev 26 of the ES6 spec](http://esdiscuss.org/topic/new-rev26-es6-draft-now-available), removes duplicate class method checks, except for "constructor".

This diff removes the dupe check from `parseMethodDefinition` and
implements it in `parseClassBody` for "constructor" only. I chose to still
keep track of static and prototype method names, since the spec
describes such a list. I moved the check to `parseClassBody` with the
intention to be able to reuse `parseMethodDefinition` for object literals
in the future.

By removing this logic, we also fix a bug that doesn't allow for two
properties with literal names. E.g.

```
class A
42() {}
"foo"() {}
}
```

currently throws a "duplicate property" error.

I changed the existing tests which previously expected errors to expect
ASTs now. I also added new tests for duplicate `constructor` properties.

`npm test` runs fine and there is no benchmark or coverage regression.

Issues covered by this PR:
https://code.google.com/p/esprima/issues/detail?id=594
https://code.google.com/p/esprima/issues/detail?id=563