We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5ba0b6 commit a74bf96Copy full SHA for a74bf96
2 files changed
src/passes/J2CLOpts.cpp
@@ -88,6 +88,10 @@ class GlobalAssignmentCollector
88
: assignmentCounts(assignmentCounts) {}
89
90
void visitGlobal(Global* curr) {
91
+ // Ignore imported globals, e.g., JS prototypes.
92
+ if (curr->imported()) {
93
+ return;
94
+ }
95
if (isInitialValue(curr->init)) {
96
return;
97
}
test/lit/passes/j2cl.wast
@@ -351,3 +351,10 @@
351
)
352
353
354
+
355
+;; Imported globals are ignored
356
+(module
357
+ ;; CHECK: (import "a" "b" (global $a.b (ref extern)))
358
+ (import "a" "b" (global $a.b (ref extern)))
359
+)
360
0 commit comments