Huáng Jùnliàng 8478027d1a
Make sure babel parser throws exactly same recoverable errors when estree plugin is enabled (#12375)
* refactor: introduce isPrivateName and getPrivateNameSV

* feat: check recoverable errors on estree-throw

* fix: pass through all params of parseBlockBody

* fix: set bigInt to null when invalid bigInt value is parsed

e.g. 0.1n

* fix: use string literal value in error message

When estree plugin is enabled, stringLiteral#extra.raw is not accessible. Use StringLiteral#value instead.

* refactor: introduce hasPropertyAsPrivateName

* fix: adapt to ChainExpression

* fix: port checkLVal early return for method in object pattern

* fix: throw new a?.() on estree

* fix: early return for __proto__ in accessors

* fix: test record element via isObjectProperty

* fix: pass through isLHS in toAssignable

* refactor: introduce isObjectMethod methods
2020-12-03 08:36:54 +00:00

69 lines
2.8 KiB
JSON

{
"type": "File",
"start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}},
"errors": [
"SyntaxError: A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '學而時習之,不亦說乎?' as '學而時習之,不亦說乎?' } from 'some-module'`? (1:9)",
"SyntaxError: A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '吾道一以貫之。' as '忠恕。' } from 'some-module'`? (1:24)"
],
"program": {
"type": "Program",
"start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}},
"local": {
"type": "StringLiteral",
"start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}},
"extra": {
"rawValue": "學而時習之,不亦說乎?",
"raw": "\"學而時習之,不亦說乎?\""
},
"value": "學而時習之,不亦說乎?"
},
"exported": {
"type": "StringLiteral",
"start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}},
"extra": {
"rawValue": "學而時習之,不亦說乎?",
"raw": "\"學而時習之,不亦說乎?\""
},
"value": "學而時習之,不亦說乎?"
}
},
{
"type": "ExportSpecifier",
"start":24,"end":42,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":42}},
"local": {
"type": "StringLiteral",
"start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33}},
"extra": {
"rawValue": "吾道一以貫之。",
"raw": "\"吾道一以貫之。\""
},
"value": "吾道一以貫之。"
},
"exported": {
"type": "StringLiteral",
"start":37,"end":42,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":42}},
"extra": {
"rawValue": "忠恕。",
"raw": "\"忠恕。\""
},
"value": "忠恕。"
}
}
],
"source": null,
"declaration": null
}
],
"directives": []
}
}