* 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 ??
311 lines
8.2 KiB
JSON
311 lines
8.2 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 64,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 42
|
|
}
|
|
},
|
|
"errors": [
|
|
"SyntaxError: Identifier 'foo' has already been declared (2:29)",
|
|
"SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:29)"
|
|
],
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 64,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 42
|
|
}
|
|
},
|
|
"sourceType": "module",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "ExportNamedDeclaration",
|
|
"start": 0,
|
|
"end": 21,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 21
|
|
}
|
|
},
|
|
"specifiers": [],
|
|
"source": null,
|
|
"declaration": {
|
|
"type": "VariableDeclaration",
|
|
"start": 7,
|
|
"end": 21,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 7
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 21
|
|
}
|
|
},
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"start": 13,
|
|
"end": 20,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 13
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 20
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 13,
|
|
"end": 16,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 13
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 16
|
|
},
|
|
"identifierName": "foo"
|
|
},
|
|
"name": "foo"
|
|
},
|
|
"init": {
|
|
"type": "NumericLiteral",
|
|
"start": 19,
|
|
"end": 20,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 19
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 20
|
|
}
|
|
},
|
|
"extra": {
|
|
"rawValue": 1,
|
|
"raw": "1"
|
|
},
|
|
"value": 1
|
|
}
|
|
}
|
|
],
|
|
"kind": "const"
|
|
}
|
|
},
|
|
{
|
|
"type": "ExportNamedDeclaration",
|
|
"start": 22,
|
|
"end": 64,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 42
|
|
}
|
|
},
|
|
"specifiers": [],
|
|
"source": null,
|
|
"declaration": {
|
|
"type": "VariableDeclaration",
|
|
"start": 29,
|
|
"end": 64,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 7
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 42
|
|
}
|
|
},
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"start": 35,
|
|
"end": 63,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 13
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 41
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "ObjectPattern",
|
|
"start": 35,
|
|
"end": 57,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 13
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 35
|
|
}
|
|
},
|
|
"properties": [
|
|
{
|
|
"type": "ObjectProperty",
|
|
"start": 37,
|
|
"end": 55,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 15
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 33
|
|
}
|
|
},
|
|
"method": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start": 37,
|
|
"end": 40,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 15
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 18
|
|
},
|
|
"identifierName": "bar"
|
|
},
|
|
"name": "bar"
|
|
},
|
|
"computed": false,
|
|
"shorthand": false,
|
|
"value": {
|
|
"type": "ArrayPattern",
|
|
"start": 42,
|
|
"end": 55,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 20
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 33
|
|
}
|
|
},
|
|
"elements": [
|
|
{
|
|
"type": "Identifier",
|
|
"start": 43,
|
|
"end": 46,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 21
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 24
|
|
},
|
|
"identifierName": "baz"
|
|
},
|
|
"name": "baz"
|
|
},
|
|
{
|
|
"type": "RestElement",
|
|
"start": 48,
|
|
"end": 54,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 26
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 32
|
|
}
|
|
},
|
|
"argument": {
|
|
"type": "Identifier",
|
|
"start": 51,
|
|
"end": 54,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 29
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 32
|
|
},
|
|
"identifierName": "foo"
|
|
},
|
|
"name": "foo"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"init": {
|
|
"type": "Identifier",
|
|
"start": 60,
|
|
"end": 63,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 38
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 41
|
|
},
|
|
"identifierName": "qux"
|
|
},
|
|
"name": "qux"
|
|
}
|
|
}
|
|
],
|
|
"kind": "const"
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |