Set generator to true during error recovery of accessor (#11987)
This commit is contained in:
parent
b9407d7660
commit
941f610275
@ -1767,6 +1767,7 @@ export default class ExpressionParser extends LValParser {
|
||||
isAccessor = true;
|
||||
prop.kind = keyName;
|
||||
if (this.match(tt.star)) {
|
||||
isGenerator = true;
|
||||
this.raise(this.state.pos, Errors.AccessorIsGenerator, keyName);
|
||||
this.next();
|
||||
}
|
||||
@ -1827,7 +1828,9 @@ export default class ExpressionParser extends LValParser {
|
||||
// isAccessor implies isAsync: false, isPattern: false, isGenerator: false
|
||||
this.parseMethod(
|
||||
prop,
|
||||
/* isGenerator */ false,
|
||||
// This _should_ be false, but with error recovery, we allow it to be
|
||||
// set for informational purposes
|
||||
isGenerator,
|
||||
/* isAsync */ false,
|
||||
/* isConstructor */ false,
|
||||
false,
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
"computed": false,
|
||||
"kind": "get",
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"generator": true,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
@ -52,7 +52,7 @@
|
||||
"computed": false,
|
||||
"kind": "set",
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"generator": true,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user