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

84 lines
3.2 KiB
JSON

{
"type": "File",
"start":0,"end":51,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":25,"index":51}},
"errors": [
"SyntaxError: Identifier 'foo' has already been declared. (2:14)",
"SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)"
],
"program": {
"type": "Program",
"start":0,"end":51,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":25,"index":51}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportNamedDeclaration",
"start":0,"end":24,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":24,"index":24}},
"specifiers": [],
"source": null,
"attributes": [],
"declaration": {
"type": "FunctionDeclaration",
"start":7,"end":24,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":24,"index":24}},
"id": {
"type": "Identifier",
"start":16,"end":19,"loc":{"start":{"line":1,"column":16,"index":16},"end":{"line":1,"column":19,"index":19},"identifierName":"foo"},
"name": "foo"
},
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":22,"end":24,"loc":{"start":{"line":1,"column":22,"index":22},"end":{"line":1,"column":24,"index":24}},
"body": [],
"directives": []
}
}
},
{
"type": "EmptyStatement",
"start":24,"end":25,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":1,"column":25,"index":25}}
},
{
"type": "ExportNamedDeclaration",
"start":26,"end":51,"loc":{"start":{"line":2,"column":0,"index":26},"end":{"line":2,"column":25,"index":51}},
"specifiers": [],
"source": null,
"attributes": [],
"declaration": {
"type": "VariableDeclaration",
"start":33,"end":51,"loc":{"start":{"line":2,"column":7,"index":33},"end":{"line":2,"column":25,"index":51}},
"declarations": [
{
"type": "VariableDeclarator",
"start":39,"end":50,"loc":{"start":{"line":2,"column":13,"index":39},"end":{"line":2,"column":24,"index":50}},
"id": {
"type": "ArrayPattern",
"start":39,"end":44,"loc":{"start":{"line":2,"column":13,"index":39},"end":{"line":2,"column":18,"index":44}},
"elements": [
{
"type": "Identifier",
"start":40,"end":43,"loc":{"start":{"line":2,"column":14,"index":40},"end":{"line":2,"column":17,"index":43},"identifierName":"foo"},
"name": "foo"
}
]
},
"init": {
"type": "Identifier",
"start":47,"end":50,"loc":{"start":{"line":2,"column":21,"index":47},"end":{"line":2,"column":24,"index":50},"identifierName":"bar"},
"name": "bar"
}
}
],
"kind": "const"
}
}
],
"directives": [],
"extra": {
"topLevelAwait": false
}
}
}