Skip to content

Commit

Permalink
Initialize range bindings to unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jun 25, 2024
1 parent c993c59 commit 836f7b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gen-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,13 +566,16 @@ export function addGeneratedRange(
originalScope ? originalScope[0] : -1,
originalScope ? originalScope[1] : -1,
];
if (isScope) range.isScope = true;
if (originalScope?.[2]) {
range.bindings = originalScope[2].map(() => [[-1]]);
}
if (callsite) {
const index = put(sources, callsite.source);
if (index === sourcesContent.length) sourcesContent[index] = null;
if (index === originalScopes.length) originalScopes[index] = [];
range.callsite = [index, callsite.line - 1, callsite.column];
}
if (isScope) range.isScope = true;
generatedRanges.push(range);

return [range, originalScope?.[2]];
Expand Down

0 comments on commit 836f7b6

Please sign in to comment.