Vivek Nayyar 66b86e088c
added basic support for module attributes and tests updated (#10962)
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-05-25 01:26:28 +02:00

78 lines
2.7 KiB
JSON

{
"type": "File",
"start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}},
"errors": [
"SyntaxError: The only accepted module attribute is `type` (1:46)"
],
"program": {
"type": "Program",
"start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ImportDeclaration",
"start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}},
"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"
},
"attributes": [
{
"type": "ImportAttribute",
"start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}},
"key": {
"type": "Identifier",
"start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36},"identifierName":"type"},
"name": "type"
},
"value": {
"type": "StringLiteral",
"start":38,"end":44,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":44}},
"extra": {
"rawValue": "json",
"raw": "\"json\""
},
"value": "json"
}
},
{
"type": "ImportAttribute",
"start":46,"end":68,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":68}},
"key": {
"type": "Identifier",
"start":46,"end":60,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":60},"identifierName":"hasOwnProperty"},
"name": "hasOwnProperty"
},
"value": {
"type": "StringLiteral",
"start":62,"end":68,"loc":{"start":{"line":1,"column":62},"end":{"line":1,"column":68}},
"extra": {
"rawValue": "true",
"raw": "\"true\""
},
"value": "true"
}
}
]
}
],
"directives": []
}
}