Files
Huáng JùnliàngandGitHub 68679c0760 polish(parser): improve ImportExpression error recovery (#17902)
* refactor: remove EstreeImportExpression type

* polish: recover from import spread and arity

* fix linting errors

* polish: print phase in import call errors

* polish: update ImportCallNotNewExpression msg

* node scripts/cleanup-fixtures.ts
2026-04-19 14:29:45 -04:00

44 lines
1.5 KiB
JSON

{
"type": "File",
"start":0,"end":23,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":23,"index":23}},
"errors": [
"SyntaxError: Cannot use new with import.defer(). (1:4)"
],
"program": {
"type": "Program",
"start":0,"end":23,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":23,"index":23}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":23,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":23,"index":23}},
"expression": {
"type": "NewExpression",
"start":0,"end":23,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":23,"index":23}},
"callee": {
"type": "ImportExpression",
"start":4,"end":23,"loc":{"start":{"line":1,"column":4,"index":4},"end":{"line":1,"column":23,"index":23}},
"phase": "defer",
"source": {
"type": "StringLiteral",
"start":17,"end":22,"loc":{"start":{"line":1,"column":17,"index":17},"end":{"line":1,"column":22,"index":22}},
"extra": {
"rawValue": "foo",
"raw": "\"foo\""
},
"value": "foo"
},
"options": null
},
"arguments": []
}
}
],
"directives": [],
"extra": {
"topLevelAwait": false
}
}
}