fix mangle on export (#2133)
- `export default ...` - `export` with `AST_Destructuring` fixes #2129
This commit is contained in:
@@ -234,8 +234,14 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
|
||||
}
|
||||
|
||||
function mark_export(def, level) {
|
||||
if (in_destructuring) {
|
||||
var i = 0;
|
||||
do {
|
||||
level++;
|
||||
} while (tw.parent(i++) !== in_destructuring);
|
||||
}
|
||||
var node = tw.parent(level);
|
||||
def.export = node instanceof AST_Export && !node.is_default;
|
||||
def.export = node instanceof AST_Export;
|
||||
}
|
||||
});
|
||||
self.walk(tw);
|
||||
|
||||
Reference in New Issue
Block a user