Recover from error for missing initializer in const declaration (#12120)
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:7)"
|
||||
}
|
||||
33
packages/babel-parser/test/fixtures/core/uncategorised/536/output.json
vendored
Normal file
33
packages/babel-parser/test/fixtures/core/uncategorised/536/output.json
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}},
|
||||
"errors": [
|
||||
"SyntaxError: Const declarations require an initialization value (1:7)"
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"a"},
|
||||
"name": "a"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "const"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user