fix(javascript): retain recovered call argument positions (#929)

This commit is contained in:
ysopwnable
2026-10-07 19:08:45 +08:00
committed by GitHub
parent 37d2ebac4c
commit e6ba9c3af3
2 changed files with 43 additions and 0 deletions
@@ -210,10 +210,13 @@ const retainedArguments = (
| t.SpreadElement
| t.JSXNamespacedName
| t.ArgumentPlaceholder
| null
)[],
): JavaScriptSemanticCallSite["arguments"] => {
const retained: JavaScriptSemanticCallSite["arguments"][number][] = [];
for (const [index, node] of nodes.entries()) {
// Babel recovery can leave null slots; retain the other argument positions.
if (node === null) continue;
retained.push({
index,
location: range(node),