@@ -6029,7 +6029,7 @@ Compressor.prototype.compress = function(node) {
|
|||||||
if (node instanceof AST_Call) {
|
if (node instanceof AST_Call) {
|
||||||
var exp = node.expression;
|
var exp = node.expression;
|
||||||
var tail = exp.tail_node();
|
var tail = exp.tail_node();
|
||||||
if (!is_lambda(tail)) {
|
if (!(tail instanceof AST_LambdaExpression)) {
|
||||||
descend();
|
descend();
|
||||||
return mark_expression(exp);
|
return mark_expression(exp);
|
||||||
}
|
}
|
||||||
@@ -6042,6 +6042,23 @@ Compressor.prototype.compress = function(node) {
|
|||||||
tail.walk(tw);
|
tail.walk(tw);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (node instanceof AST_Class) {
|
||||||
|
if (node.name) node.name.walk(tw);
|
||||||
|
if (node.extends) node.extends.walk(tw);
|
||||||
|
node.properties.filter(function(prop) {
|
||||||
|
if (prop.key instanceof AST_Node) prop.key.walk(tw);
|
||||||
|
return prop.value;
|
||||||
|
}).forEach(function(prop) {
|
||||||
|
if (prop.static) {
|
||||||
|
prop.value.walk(tw);
|
||||||
|
} else {
|
||||||
|
push(tw);
|
||||||
|
prop.value.walk(tw);
|
||||||
|
pop(tw);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (node instanceof AST_Conditional) {
|
if (node instanceof AST_Conditional) {
|
||||||
walk_cond(node.condition, node.consequent, node.alternative);
|
walk_cond(node.condition, node.consequent, node.alternative);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -2476,3 +2476,29 @@ issue_5322: {
|
|||||||
expect_stdout: "42"
|
expect_stdout: "42"
|
||||||
node_version: ">=12"
|
node_version: ">=12"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5352: {
|
||||||
|
options = {
|
||||||
|
merge_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
function f(a) {
|
||||||
|
var b;
|
||||||
|
new class {
|
||||||
|
[b = console.log(a)] = b;
|
||||||
|
}(a.p);
|
||||||
|
}
|
||||||
|
f("PASS");
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
function f(a) {
|
||||||
|
var b;
|
||||||
|
new class {
|
||||||
|
[b = console.log(a)] = b;
|
||||||
|
}(a.p);
|
||||||
|
}
|
||||||
|
f("PASS");
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=12"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user