Huáng Jùnliàng 21d7ee2610 String import/export specifier (#12091)
* feat: parse moduleExportName
* feat: add validators
* Support string specifier name in commonjs transform
* Support string specifier name in export-ns-from
* test: add loose testcases
* test: add testcases for amd and umd
* feat: support systemjs
* test: update fixtures fixed in #12110
* add plugin name typings
* test: rename test layout
* feat: implement under moduleStringNames flag
* chore: add plugin syntax module string names
* feat: support ModuleExportName as ModuleExportName
* test: update test fixtures
* fix flow errors
* docs: update AST spec
* feat: support { "some imports" as "some exports" }
* feat: support { "some imports" as "some exports" } in systemjs
* test: add test on `import { "foo" }`
* Address review comments
* add moduleStringNames to missing plugin helpers
* Apply suggestions from code review
* update test fixtures
* Update packages/babel-parser/src/parser/error-message.js
* update test fixtures

Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 20:01:37 +02:00

64 lines
2.3 KiB
JSON

{
"type": "File",
"start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}},
"program": {
"type": "Program",
"start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "VariableDeclaration",
"start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}},
"declarations": [
{
"type": "VariableDeclarator",
"start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}},
"id": {
"type": "Identifier",
"start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15},"identifierName":"quotation"},
"name": "quotation"
},
"init": {
"type": "StringLiteral",
"start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}},
"extra": {
"rawValue": "",
"raw": "\"\""
},
"value": ""
}
}
],
"kind": "const"
},
{
"type": "ExportNamedDeclaration",
"start":22,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":31,"end":57,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":35}},
"local": {
"type": "Identifier",
"start":31,"end":40,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":18},"identifierName":"quotation"},
"name": "quotation"
},
"exported": {
"type": "StringLiteral",
"start":44,"end":57,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":35}},
"extra": {
"rawValue": "學而時習之,不亦說乎?",
"raw": "\"學而時習之,不亦說乎?\""
},
"value": "學而時習之,不亦說乎?"
}
}
],
"source": null,
"declaration": null
}
],
"directives": []
}
}