mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-27 00:17:32 +01:00
Merge pull request #2683 from theit8514/statc-ram-imports
Handle 'export default' in static RAM calculation
This commit is contained in:
commit
0dbf2c48cc
@ -388,7 +388,8 @@ function parseOnlyCalculateDeps(code: string, currentModule: string): any {
|
||||
}
|
||||
},
|
||||
FunctionDeclaration: (node: any) => {
|
||||
const key = currentModule + "." + node.id.name;
|
||||
// node.id will be null when using 'export default'. Add a module name indicating the default export.
|
||||
const key = currentModule + "." + (node.id === null ? "__SPECIAL_DEFAULT_EXPORT__" : node.id.name);
|
||||
walk.recursive(node, { key: key }, commonVisitors());
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user