Recover from "missing semicolon" errors (#12437)

* Recover from "missing semicolon" errors

* Update other tests

* Fix flow

* Fix windows test

* Add back deleted test
This commit is contained in:
Nicolò Ribaudo
2021-02-01 10:08:43 +01:00
committed by GitHub
parent 2ea0a5d021
commit 8cf0a757d5
127 changed files with 2077 additions and 164 deletions

View File

@@ -1,4 +1,3 @@
{
"plugins": ["functionSent"],
"throws": "Unexpected token, expected \";\" (2:18)"
"plugins": ["functionSent"]
}

View File

@@ -0,0 +1,64 @@
{
"type": "File",
"start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}},
"errors": [
"SyntaxError: Missing semicolon (2:17)"
],
"program": {
"type": "Program",
"start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}},
"id": {
"type": "Identifier",
"start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"},
"name": "foo"
},
"generator": true,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":16,"end":40,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}},
"body": [
{
"type": "ExpressionStatement",
"start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}},
"expression": {
"type": "CallExpression",
"start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}},
"callee": {
"type": "MetaProperty",
"start":20,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}},
"meta": {
"type": "Identifier",
"start":20,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10},"identifierName":"function"},
"name": "function"
},
"property": {
"type": "Identifier",
"start":29,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15},"identifierName":"sent"},
"name": "sent"
}
},
"arguments": []
}
},
{
"type": "BlockStatement",
"start":36,"end":38,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}},
"body": [],
"directives": []
}
],
"directives": []
}
}
],
"directives": []
}
}