Example code. class A { static async get test() { } }
Exception: SyntaxError: Unexpected identifier 'get'. Expected an opening '(' before a method's parameter list.
(In reply to Yusuke Suzuki from comment #1) > Exception: SyntaxError: Unexpected identifier 'get'. Expected an opening '(' > before a method's parameter list. This is a tricky one, but I'm not sure if this is a legit bug. The message may sound confusing, but we could see this as the following program when we apply automatic semicolon insertion (ASI): ``` class A { static async; get test() { } } ``` Since we don't support static class fields yet, the syntax error seems correct, given it is expected `function` or `PropertyName` after `async`(https://tc39.es/ecma262/#prod-AsyncFunctionDeclaration). A case that we could derivate from given example that parses correctly is: ``` class A { async get test() { } } ``` This should result in an object with field `async` and `get test`. We can define `get` and `set` as field, but a `FieldDefinition` requires a semicolon (https://tc39.es/proposal-class-fields/#prod-ClassElement). Since `get` or `set` aren't restricted tokens, there is no ASI there and they are parsed as a setter/getter definition. I remember adding some tests for cases of `get`, `set`, `async` and `static` as field names, but I need to double check if it was here or in Test262. Anyway, increasing test coverage is almost never a bad idea.
It is fixed at some point.