white lists getter and setter acceseors for having stage-2 decorators (#766)

- adds `get` and `set` kind in addition to `method` to the list of allowed class members for having a decorator,
- adds tests for this two cases (decorator + set and decorator + get)
This commit is contained in:
M Behzad
2017-10-31 16:13:04 +01:00
committed by Daniel Tschinder
parent 86abc16b37
commit fee7de2c1d
5 changed files with 375 additions and 1 deletions

View File

@@ -899,7 +899,7 @@ export default class StatementParser extends ExpressionParser {
if (
this.hasPlugin("decorators2") &&
member.kind != "method" &&
["method", "get", "set"].indexOf(member.kind) === -1 &&
member.decorators &&
member.decorators.length > 0
) {