Skip to content

Commit

Permalink
Fix static ram calculation when exports are renamed (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
G4mingJon4s authored Jul 9, 2023
1 parent 351a7fc commit e4d3a90
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Script/RamCalculations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,18 @@ function parseOnlyCalculateDeps(code: string, currentModule: string): ParseDepsR
const key = currentModule + "." + (node.id === null ? "__SPECIAL_DEFAULT_EXPORT__" : node.id.name);
walk.recursive(node, { key: key }, commonVisitors());
},
ExportNamedDeclaration: (node: Node, st: State, walkDeeper: walk.WalkerCallback<State>) => {
if (node.declaration !== null) {
// if this is true, the statement is not a named export, but rather a exported function/variable
walkDeeper(node.declaration, st);
return;
}
const specifiers = node.specifiers;

for (const specifier of specifiers) {
addRef(st.key, specifier.local.name);
}
},
},
commonVisitors(),
),
Expand Down

0 comments on commit e4d3a90

Please sign in to comment.