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

99 lines
4.0 KiB
JSON

{
"type": "File",
"start":0,"end":56,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":22,"index":56}},
"errors": [
"SyntaxError: Identifier 'foo2' has already been declared. (2:13)",
"SyntaxError: `foo2` has already been exported. Exported identifiers must be unique. (2:13)"
],
"program": {
"type": "Program",
"start":0,"end":56,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":22,"index":56}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":33,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":33,"index":33}},
"specifiers": [],
"source": null,
"attributes": [],
"declaration": {
"type": "VariableDeclaration",
"start":7,"end":33,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":33,"index":33}},
"declarations": [
{
"type": "VariableDeclarator",
"start":13,"end":32,"loc":{"start":{"line":1,"column":13,"index":13},"end":{"line":1,"column":32,"index":32}},
"id": {
"type": "ObjectPattern",
"start":13,"end":26,"loc":{"start":{"line":1,"column":13,"index":13},"end":{"line":1,"column":26,"index":26}},
"properties": [
{
"type": "ObjectProperty",
"start":15,"end":24,"loc":{"start":{"line":1,"column":15,"index":15},"end":{"line":1,"column":24,"index":24}},
"key": {
"type": "Identifier",
"start":15,"end":18,"loc":{"start":{"line":1,"column":15,"index":15},"end":{"line":1,"column":18,"index":18},"identifierName":"foo"},
"name": "foo"
},
"computed": false,
"method": false,
"shorthand": false,
"value": {
"type": "Identifier",
"start":20,"end":24,"loc":{"start":{"line":1,"column":20,"index":20},"end":{"line":1,"column":24,"index":24},"identifierName":"foo2"},
"name": "foo2"
}
}
]
},
"init": {
"type": "Identifier",
"start":29,"end":32,"loc":{"start":{"line":1,"column":29,"index":29},"end":{"line":1,"column":32,"index":32},"identifierName":"bar"},
"name": "bar"
}
}
],
"kind": "const"
}
},
{
"type": "ExportNamedDeclaration",
"start":34,"end":56,"loc":{"start":{"line":2,"column":0,"index":34},"end":{"line":2,"column":22,"index":56}},
"specifiers": [],
"source": null,
"attributes": [],
"declaration": {
"type": "VariableDeclaration",
"start":41,"end":56,"loc":{"start":{"line":2,"column":7,"index":41},"end":{"line":2,"column":22,"index":56}},
"declarations": [
{
"type": "VariableDeclarator",
"start":47,"end":55,"loc":{"start":{"line":2,"column":13,"index":47},"end":{"line":2,"column":21,"index":55}},
"id": {
"type": "Identifier",
"start":47,"end":51,"loc":{"start":{"line":2,"column":13,"index":47},"end":{"line":2,"column":17,"index":51},"identifierName":"foo2"},
"name": "foo2"
},
"init": {
"type": "NumericLiteral",
"start":54,"end":55,"loc":{"start":{"line":2,"column":20,"index":54},"end":{"line":2,"column":21,"index":55}},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
}
],
"kind": "const"
}
}
],
"directives": [],
"extra": {
"topLevelAwait": false
}
}
}