fix corner case with import (#4672)
This commit is contained in:
@@ -197,7 +197,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
|
||||
} else if (node instanceof AST_SymbolLet) {
|
||||
scope.def_variable(node).exported = exported;
|
||||
} else if (node instanceof AST_SymbolVar) {
|
||||
defun.def_variable(node, null).exported = exported;
|
||||
defun.def_variable(node, node instanceof AST_SymbolImport ? undefined : null).exported = exported;
|
||||
entangle(defun, scope);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,3 +128,19 @@ rename_mangle: {
|
||||
import * as r from "moz";
|
||||
}
|
||||
}
|
||||
|
||||
keep_ref: {
|
||||
options = {
|
||||
reduce_vars: true,
|
||||
toplevel: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
import foo from "bar";
|
||||
foo();
|
||||
}
|
||||
expect: {
|
||||
import foo from "bar";
|
||||
foo();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user