* Add error recovery support to @babel/parser * Update @babel/parser tests to always recover from errors * Update this.raise usage in @babel/parser: - expression.js - lval.js - statement.js - estree.js - flow.js - jsx/index.js - tokenizer/index.js * Update @babel/parser fixtures with recovered errors * Fix tests out of @babel/parser * Do not use try/catch for control flow * Update invalid fixtures * Do not report invalid lhs in toAssignable * Do not validate function id multiple times * Dedupe reserved await errors * Remove duplicate errors about strict reserved bindings * Remove duplicated error about yield/await inside params * Don't error twice for methods in object patterns * Don't report invalid super() twice * Remove dup error about reserved param for expr arrows * Remove double escapes in migrated tests * Dedupe errors about invalid escapes in identifiers * Remove duplicated error about decorated constructor * Remove duplicated error about spread in flow class * Don't throw for invalid super usage * Don't fail for object decorators with stage 2 * Fix flow inexact type errors * Fix flow * Fix errors about escapes in keywords (ref: #10455) * Update after rebase * Fix todo * Remove duplicated error when using += for defaults * Remove unnecessary throw * Nit: use ??
210 lines
4.8 KiB
JSON
210 lines
4.8 KiB
JSON
{
|
||
"type": "File",
|
||
"start": 0,
|
||
"end": 61,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 0
|
||
},
|
||
"end": {
|
||
"line": 3,
|
||
"column": 1
|
||
}
|
||
},
|
||
"errors": [
|
||
"SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:17)"
|
||
],
|
||
"program": {
|
||
"type": "Program",
|
||
"start": 0,
|
||
"end": 61,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 0
|
||
},
|
||
"end": {
|
||
"line": 3,
|
||
"column": 1
|
||
}
|
||
},
|
||
"sourceType": "module",
|
||
"interpreter": null,
|
||
"body": [
|
||
{
|
||
"type": "FunctionDeclaration",
|
||
"start": 0,
|
||
"end": 61,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 0
|
||
},
|
||
"end": {
|
||
"line": 3,
|
||
"column": 1
|
||
}
|
||
},
|
||
"id": {
|
||
"type": "Identifier",
|
||
"start": 9,
|
||
"end": 12,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 9
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 12
|
||
},
|
||
"identifierName": "foo"
|
||
},
|
||
"name": "foo"
|
||
},
|
||
"generator": false,
|
||
"async": false,
|
||
"params": [
|
||
{
|
||
"type": "Identifier",
|
||
"start": 13,
|
||
"end": 14,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 13
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 14
|
||
},
|
||
"identifierName": "x"
|
||
},
|
||
"name": "x"
|
||
}
|
||
],
|
||
"predicate": {
|
||
"type": "InferredPredicate",
|
||
"start": 17,
|
||
"end": 25,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 17
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 25
|
||
}
|
||
}
|
||
},
|
||
"returnType": null,
|
||
"body": {
|
||
"type": "BlockStatement",
|
||
"start": 26,
|
||
"end": 61,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 26
|
||
},
|
||
"end": {
|
||
"line": 3,
|
||
"column": 1
|
||
}
|
||
},
|
||
"body": [
|
||
{
|
||
"type": "ReturnStatement",
|
||
"start": 30,
|
||
"end": 59,
|
||
"loc": {
|
||
"start": {
|
||
"line": 2,
|
||
"column": 2
|
||
},
|
||
"end": {
|
||
"line": 2,
|
||
"column": 31
|
||
}
|
||
},
|
||
"argument": {
|
||
"type": "BinaryExpression",
|
||
"start": 37,
|
||
"end": 58,
|
||
"loc": {
|
||
"start": {
|
||
"line": 2,
|
||
"column": 9
|
||
},
|
||
"end": {
|
||
"line": 2,
|
||
"column": 30
|
||
}
|
||
},
|
||
"left": {
|
||
"type": "UnaryExpression",
|
||
"start": 37,
|
||
"end": 45,
|
||
"loc": {
|
||
"start": {
|
||
"line": 2,
|
||
"column": 9
|
||
},
|
||
"end": {
|
||
"line": 2,
|
||
"column": 17
|
||
}
|
||
},
|
||
"operator": "typeof",
|
||
"prefix": true,
|
||
"argument": {
|
||
"type": "Identifier",
|
||
"start": 44,
|
||
"end": 45,
|
||
"loc": {
|
||
"start": {
|
||
"line": 2,
|
||
"column": 16
|
||
},
|
||
"end": {
|
||
"line": 2,
|
||
"column": 17
|
||
},
|
||
"identifierName": "x"
|
||
},
|
||
"name": "x"
|
||
}
|
||
},
|
||
"operator": "===",
|
||
"right": {
|
||
"type": "StringLiteral",
|
||
"start": 50,
|
||
"end": 58,
|
||
"loc": {
|
||
"start": {
|
||
"line": 2,
|
||
"column": 22
|
||
},
|
||
"end": {
|
||
"line": 2,
|
||
"column": 30
|
||
}
|
||
},
|
||
"extra": {
|
||
"rawValue": "string",
|
||
"raw": "\"string\""
|
||
},
|
||
"value": "string"
|
||
}
|
||
}
|
||
}
|
||
],
|
||
"directives": []
|
||
}
|
||
}
|
||
],
|
||
"directives": []
|
||
}
|
||
} |