diff options
Diffstat (limited to 'src/passes/RemoveImports.cpp')
-rw-r--r-- | src/passes/RemoveImports.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/passes/RemoveImports.cpp b/src/passes/RemoveImports.cpp index 88fb43520..6de151230 100644 --- a/src/passes/RemoveImports.cpp +++ b/src/passes/RemoveImports.cpp @@ -15,7 +15,7 @@ */ // -// Removeds imports, and replaces them with nops. This is useful +// Removes function imports, and replaces them with nops. This is useful // for running a module through the reference interpreter, which // does not validate imports for a JS environment (by removing // imports, we can at least get the reference interpreter to @@ -42,7 +42,9 @@ struct RemoveImports : public WalkerPass<PostWalker<RemoveImports>> { void visitModule(Module *curr) { std::vector<Name> names; for (auto& import : curr->imports) { - names.push_back(import->name); + if (import->kind == ExternalKind::Function) { + names.push_back(import->name); + } } for (auto& name : names) { curr->removeImport(name); |