@@ -11460,7 +11460,10 @@ merge(Compressor.prototype, {
|
|||||||
props = props.map(function(prop) {
|
props = props.map(function(prop) {
|
||||||
return prop.value;
|
return prop.value;
|
||||||
});
|
});
|
||||||
if (prop instanceof AST_ObjectMethod && prop.value instanceof AST_Function) {
|
if (prop instanceof AST_ObjectMethod
|
||||||
|
&& prop.value instanceof AST_Function
|
||||||
|
&& !(compressor.parent() instanceof AST_Call)) {
|
||||||
|
if (prop.value.uses_arguments) break;
|
||||||
props[i] = make_node(AST_Arrow, prop.value, prop.value);
|
props[i] = make_node(AST_Arrow, prop.value, prop.value);
|
||||||
}
|
}
|
||||||
return make_node(AST_Sub, this, {
|
return make_node(AST_Sub, this, {
|
||||||
|
|||||||
@@ -1345,7 +1345,7 @@ issue_4821_2: {
|
|||||||
node_version: ">=12"
|
node_version: ">=12"
|
||||||
}
|
}
|
||||||
|
|
||||||
issue_4829: {
|
issue_4829_1: {
|
||||||
options = {
|
options = {
|
||||||
properties: true,
|
properties: true,
|
||||||
}
|
}
|
||||||
@@ -1368,3 +1368,35 @@ issue_4829: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=4"
|
node_version: ">=4"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4829_2: {
|
||||||
|
options = {
|
||||||
|
properties: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
"use strict";
|
||||||
|
try {
|
||||||
|
class A extends {
|
||||||
|
f() {
|
||||||
|
return arguments;
|
||||||
|
},
|
||||||
|
}.f {}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("PASS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
"use strict";
|
||||||
|
try {
|
||||||
|
class A extends {
|
||||||
|
f() {
|
||||||
|
return arguments;
|
||||||
|
},
|
||||||
|
}.f {}
|
||||||
|
} catch (e) {
|
||||||
|
console.log("PASS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=4"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1400,3 +1400,49 @@ object_super: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=4"
|
node_version: ">=4"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4831_1: {
|
||||||
|
options = {
|
||||||
|
properties: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log({
|
||||||
|
f() {
|
||||||
|
return arguments;
|
||||||
|
},
|
||||||
|
}.f("PASS")[0]);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log([
|
||||||
|
function() {
|
||||||
|
return arguments;
|
||||||
|
},
|
||||||
|
][0]("PASS")[0]);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=4"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_4831_2: {
|
||||||
|
options = {
|
||||||
|
properties: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var f = {
|
||||||
|
f() {
|
||||||
|
return arguments;
|
||||||
|
},
|
||||||
|
}.f;
|
||||||
|
console.log(f("PASS")[0]);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var f = {
|
||||||
|
f() {
|
||||||
|
return arguments;
|
||||||
|
},
|
||||||
|
}.f;
|
||||||
|
console.log(f("PASS")[0]);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=4"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user