upgrade AST<->ESTree translation (#4870)

fixes #968
This commit is contained in:
Alex Lam S.L
2021-04-26 04:23:52 +08:00
committed by GitHub
parent 80efaa2f33
commit 324587f769
8 changed files with 801 additions and 177 deletions

View File

@@ -6562,6 +6562,10 @@ merge(Compressor.prototype, {
}
return insert_statements(body, node, in_list);
}
if (node instanceof AST_Import) {
if (node.properties && node.properties == 0) node.properties = null;
return node;
}
if (node instanceof AST_Sequence) {
if (node.expressions.length > 1) return;
return maintain_this_binding(compressor, tt.parent(), node, node.expressions[0]);