From 31ebdbb139981a604bd0e8fc1e364916762e11b9 Mon Sep 17 00:00:00 2001
From: theit8514 <theit8514@users.noreply.github.com>
Date: Mon, 17 Jan 2022 13:16:03 -0500
Subject: [PATCH] Handle 'export default' in static RAM calculation

---
 src/Script/RamCalculations.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Script/RamCalculations.ts b/src/Script/RamCalculations.ts
index 4b58a3512..25e699e23 100644
--- a/src/Script/RamCalculations.ts
+++ b/src/Script/RamCalculations.ts
@@ -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());
         },
       },