fix new keyword broken by recent refactoring (#9377)
This commit is contained in:
parent
f6ee26c3da
commit
af88e63dff
@ -184,7 +184,7 @@ export const keywords = Object.create(null, {
|
|||||||
const: makeKeywordProps("const"),
|
const: makeKeywordProps("const"),
|
||||||
while: makeKeywordProps("while", { isLoop }),
|
while: makeKeywordProps("while", { isLoop }),
|
||||||
with: makeKeywordProps("with"),
|
with: makeKeywordProps("with"),
|
||||||
new: makeKeywordProps("new"),
|
new: makeKeywordProps("new", { beforeExpr, startsExpr }),
|
||||||
this: makeKeywordProps("this", { startsExpr }),
|
this: makeKeywordProps("this", { startsExpr }),
|
||||||
super: makeKeywordProps("super", { startsExpr }),
|
super: makeKeywordProps("super", { startsExpr }),
|
||||||
class: makeKeywordProps("class", { startsExpr }),
|
class: makeKeywordProps("class", { startsExpr }),
|
||||||
|
|||||||
3
packages/babel-parser/test/fixtures/core/regression/9374/input.js
vendored
Normal file
3
packages/babel-parser/test/fixtures/core/regression/9374/input.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function* test() {
|
||||||
|
yield new Foo();
|
||||||
|
}
|
||||||
152
packages/babel-parser/test/fixtures/core/regression/9374/output.json
vendored
Normal file
152
packages/babel-parser/test/fixtures/core/regression/9374/output.json
vendored
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
{
|
||||||
|
"type": "File",
|
||||||
|
"start": 0,
|
||||||
|
"end": 39,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 1,
|
||||||
|
"column": 0
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 3,
|
||||||
|
"column": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"program": {
|
||||||
|
"type": "Program",
|
||||||
|
"start": 0,
|
||||||
|
"end": 39,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 1,
|
||||||
|
"column": 0
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 3,
|
||||||
|
"column": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sourceType": "script",
|
||||||
|
"interpreter": null,
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"type": "FunctionDeclaration",
|
||||||
|
"start": 0,
|
||||||
|
"end": 39,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 1,
|
||||||
|
"column": 0
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 3,
|
||||||
|
"column": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 10,
|
||||||
|
"end": 14,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 1,
|
||||||
|
"column": 10
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 1,
|
||||||
|
"column": 14
|
||||||
|
},
|
||||||
|
"identifierName": "test"
|
||||||
|
},
|
||||||
|
"name": "test"
|
||||||
|
},
|
||||||
|
"generator": true,
|
||||||
|
"async": false,
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"type": "BlockStatement",
|
||||||
|
"start": 17,
|
||||||
|
"end": 39,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 1,
|
||||||
|
"column": 17
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 3,
|
||||||
|
"column": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"type": "ExpressionStatement",
|
||||||
|
"start": 21,
|
||||||
|
"end": 37,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 2
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 18
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"expression": {
|
||||||
|
"type": "YieldExpression",
|
||||||
|
"start": 21,
|
||||||
|
"end": 36,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 2
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 17
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delegate": false,
|
||||||
|
"argument": {
|
||||||
|
"type": "NewExpression",
|
||||||
|
"start": 27,
|
||||||
|
"end": 36,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 8
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 17
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"callee": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 31,
|
||||||
|
"end": 34,
|
||||||
|
"loc": {
|
||||||
|
"start": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 12
|
||||||
|
},
|
||||||
|
"end": {
|
||||||
|
"line": 2,
|
||||||
|
"column": 15
|
||||||
|
},
|
||||||
|
"identifierName": "Foo"
|
||||||
|
},
|
||||||
|
"name": "Foo"
|
||||||
|
},
|
||||||
|
"arguments": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"directives": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"directives": []
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user