Files
babel/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json
Sven Sauleau af8e0facc1 Parse import-assertions (#12139)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-10-14 21:18:16 +02:00

60 lines
2.0 KiB
JSON

{
"type": "File",
"start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},
"errors": [
"SyntaxError: The only accepted module attribute is `type` (1:36)"
],
"program": {
"type": "Program",
"start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ImportDeclaration",
"start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}},
"local": {
"type": "Identifier",
"start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"},
"name": "foo"
}
}
],
"source": {
"type": "StringLiteral",
"start":16,"end":26,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":26}},
"extra": {
"rawValue": "foo.json",
"raw": "\"foo.json\""
},
"value": "foo.json"
},
"assertions": [
{
"type": "ImportAttribute",
"start":36,"end":46,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":46}},
"key": {
"type": "Identifier",
"start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39},"identifierName":"for"},
"name": "for"
},
"value": {
"type": "StringLiteral",
"start":41,"end":46,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":46}},
"extra": {
"rawValue": "for",
"raw": "\"for\""
},
"value": "for"
}
}
]
}
],
"directives": []
}
}