* 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 ??
241 lines
6.1 KiB
JSON
241 lines
6.1 KiB
JSON
{
|
||
"type": "File",
|
||
"start": 0,
|
||
"end": 54,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 0
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 54
|
||
}
|
||
},
|
||
"errors": [
|
||
"SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:20)"
|
||
],
|
||
"program": {
|
||
"type": "Program",
|
||
"start": 0,
|
||
"end": 54,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 0
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 54
|
||
}
|
||
},
|
||
"sourceType": "module",
|
||
"interpreter": null,
|
||
"body": [
|
||
{
|
||
"type": "VariableDeclaration",
|
||
"start": 0,
|
||
"end": 54,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 0
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 54
|
||
}
|
||
},
|
||
"declarations": [
|
||
{
|
||
"type": "VariableDeclarator",
|
||
"start": 4,
|
||
"end": 53,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 4
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 53
|
||
}
|
||
},
|
||
"id": {
|
||
"type": "Identifier",
|
||
"start": 4,
|
||
"end": 5,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 4
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 5
|
||
},
|
||
"identifierName": "f"
|
||
},
|
||
"name": "f"
|
||
},
|
||
"init": {
|
||
"type": "ArrowFunctionExpression",
|
||
"start": 8,
|
||
"end": 53,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 8
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 53
|
||
}
|
||
},
|
||
"predicate": {
|
||
"type": "InferredPredicate",
|
||
"start": 20,
|
||
"end": 28,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 20
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 28
|
||
}
|
||
}
|
||
},
|
||
"returnType": null,
|
||
"id": null,
|
||
"generator": false,
|
||
"async": false,
|
||
"params": [
|
||
{
|
||
"type": "Identifier",
|
||
"start": 9,
|
||
"end": 17,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 9
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 17
|
||
},
|
||
"identifierName": "x"
|
||
},
|
||
"name": "x",
|
||
"typeAnnotation": {
|
||
"type": "TypeAnnotation",
|
||
"start": 10,
|
||
"end": 17,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 10
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 17
|
||
}
|
||
},
|
||
"typeAnnotation": {
|
||
"type": "MixedTypeAnnotation",
|
||
"start": 12,
|
||
"end": 17,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 12
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 17
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
],
|
||
"body": {
|
||
"type": "BinaryExpression",
|
||
"start": 32,
|
||
"end": 53,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 32
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 53
|
||
}
|
||
},
|
||
"left": {
|
||
"type": "UnaryExpression",
|
||
"start": 32,
|
||
"end": 40,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 32
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 40
|
||
}
|
||
},
|
||
"operator": "typeof",
|
||
"prefix": true,
|
||
"argument": {
|
||
"type": "Identifier",
|
||
"start": 39,
|
||
"end": 40,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 39
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 40
|
||
},
|
||
"identifierName": "x"
|
||
},
|
||
"name": "x"
|
||
}
|
||
},
|
||
"operator": "===",
|
||
"right": {
|
||
"type": "StringLiteral",
|
||
"start": 45,
|
||
"end": 53,
|
||
"loc": {
|
||
"start": {
|
||
"line": 1,
|
||
"column": 45
|
||
},
|
||
"end": {
|
||
"line": 1,
|
||
"column": 53
|
||
}
|
||
},
|
||
"extra": {
|
||
"rawValue": "string",
|
||
"raw": "\"string\""
|
||
},
|
||
"value": "string"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
],
|
||
"kind": "var"
|
||
}
|
||
],
|
||
"directives": []
|
||
}
|
||
} |