@@ -11374,15 +11374,6 @@ merge(Compressor.prototype, {
|
||||
if (!tag) status = typeof trimmed;
|
||||
}
|
||||
if (!tag && strs.length > 1) {
|
||||
if (strs[0] == "") return make_node(AST_Binary, self, {
|
||||
operator: "+",
|
||||
left: exprs[0],
|
||||
right: make_node(AST_Template, self, {
|
||||
expressions: exprs.slice(1),
|
||||
strings: strs.slice(1),
|
||||
tag: tag,
|
||||
}).transform(compressor),
|
||||
}).optimize(compressor);
|
||||
if (strs[strs.length - 1] == "") return make_node(AST_Binary, self, {
|
||||
operator: "+",
|
||||
left: make_node(AST_Template, self, {
|
||||
@@ -11392,6 +11383,15 @@ merge(Compressor.prototype, {
|
||||
}).transform(compressor),
|
||||
right: exprs[exprs.length - 1],
|
||||
}).optimize(compressor);
|
||||
if (strs[0] == "") return make_node(AST_Binary, self, {
|
||||
operator: "+",
|
||||
left: exprs[0],
|
||||
right: make_node(AST_Template, self, {
|
||||
expressions: exprs.slice(1),
|
||||
strings: strs.slice(1),
|
||||
tag: tag,
|
||||
}).transform(compressor),
|
||||
}).optimize(compressor);
|
||||
}
|
||||
self.expressions = exprs;
|
||||
self.strings = strs;
|
||||
|
||||
@@ -685,3 +685,17 @@ issue_5125_8: {
|
||||
expect_stdout: "undefinedundefinedundefined PASS"
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
issue_5136: {
|
||||
options = {
|
||||
templates: true,
|
||||
}
|
||||
input: {
|
||||
console.log(`${A = []}${A[0] = 42}`);
|
||||
}
|
||||
expect: {
|
||||
console.log(`` + (A = []) + (A[0] = 42));
|
||||
}
|
||||
expect_stdout: "42"
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user