jshint/jshint — pull request #1374 by traviskaufman (2013-11-20 22:42:10+00:00)
Title: Concise method support for functions named `get` and `set` when `esnext` flag is enabled

This patch modifies getter and setter checks so that if the `esnext` flag is enabled, jshint will not treat functions named 'get' and 'set' as getters/setters (respectively) *unless* there is a property name specified after it, so that the [ES6 method definition shorthand syntax](https://github.com/dherman/tc39-codex-wiki/blob/master/data/es6/object-literal-enhancements/index.md#method-definition-shorthand) can be used with functions with those names.

As an example, consider the following code snippet:

```javascript
var ins = [];
var outs = [];
var SimpleMap = {
get(key) {
return outs[ins.indexOf(key)] || null;
},
set(key, value) {
ins.push(key);
outs.push(value);
},
has(key) {
return ins.indexOf(key) >= 0;
},
delete(key) {
var idx = this.indexOf(key);
if (idx >= 0) {
ins.splice(idx, 1);
outs.splice(idx, 1);
}
}
};
```

If one were to run this code through jshint with `esnext` enabled, it would complain about the `get` and `set` methods, even though this is perfectly valid ES6 code. This is because the parser is checking for properties defined with the names `get` and `set` and if there isn't a `:` right after it, it assumes that it's an accessor property. This patch modifies this code to take into account that it also may be ES6 shorthand, but still complains when `esnext` is not enabled.

One potential issue that still remains unsolved in this case are when `get` and `set` are used in conjunction with `Object.defineProperty` or `Object.create`:

```javascript
var s = '';
var o = Object.create(Object.prototype, {
str: {
get() {
return s;
},
set(v) {
s = String(v);
}
}
});
```

This is a case where both the shorthand is being used *and* `get` and `set` are being used as accessor properties. Not sure what the best way to currently handle this would be.

Another potential issue may be that I am a total n00b when it comes to Javascript parsers (or parsers in general), and I gave this my college best because I didn't want to just throw an issue up here without attempting to fix it. But please let me know if I am horribly off track in my implementation.

Finally thanks for this amazing module; I use it in all of my personal projects and my code would be much worse off without it!