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