Files
Huáng JùnliàngandGitHub 61bea4ddf5 Fix: always initialize ExportDeclaration attributes (#17164)
* chore: bump eslint and espree

* fix: always initialize ExportDeclaration attributes

* update AST fixtures

* fix: initialize attributes when importAssertions is not enabled

* update AST fixtures

* update test snapshot

* update Makefile.js

* update Babel 8 AST fixtures
2025-03-06 15:29:46 -05:00

69 lines
2.5 KiB
JSON

{
"type": "File",
"start":0,"end":36,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":20,"index":36}},
"errors": [
"SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:0)"
],
"program": {
"type": "Program",
"start":0,"end":36,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":20,"index":36}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":15,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":15,"index":15}},
"specifiers": [
{
"type": "ExportSpecifier",
"start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12}},
"local": {
"type": "Identifier",
"start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12},"identifierName":"Foo"},
"name": "Foo"
},
"exported": {
"type": "Identifier",
"start":9,"end":12,"loc":{"start":{"line":1,"column":9,"index":9},"end":{"line":1,"column":12,"index":12},"identifierName":"Foo"},
"name": "Foo"
}
}
],
"source": null,
"declaration": null,
"attributes": []
},
{
"type": "ExportNamedDeclaration",
"start":16,"end":35,"loc":{"start":{"line":2,"column":0,"index":16},"end":{"line":2,"column":19,"index":35}},
"specifiers": [],
"source": null,
"attributes": [],
"declaration": {
"type": "ClassDeclaration",
"start":23,"end":35,"loc":{"start":{"line":2,"column":7,"index":23},"end":{"line":2,"column":19,"index":35}},
"id": {
"type": "Identifier",
"start":29,"end":32,"loc":{"start":{"line":2,"column":13,"index":29},"end":{"line":2,"column":16,"index":32},"identifierName":"Foo"},
"name": "Foo"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start":33,"end":35,"loc":{"start":{"line":2,"column":17,"index":33},"end":{"line":2,"column":19,"index":35}},
"body": []
}
}
},
{
"type": "EmptyStatement",
"start":35,"end":36,"loc":{"start":{"line":2,"column":19,"index":35},"end":{"line":2,"column":20,"index":36}}
}
],
"directives": [],
"extra": {
"topLevelAwait": false
}
}
}