@@ -3592,10 +3592,7 @@ merge(Compressor.prototype, {
|
|||||||
key = key._eval(compressor, ignore_side_effects, cached, depth);
|
key = key._eval(compressor, ignore_side_effects, cached, depth);
|
||||||
if (key === prop.key) return this;
|
if (key === prop.key) return this;
|
||||||
}
|
}
|
||||||
if (prop.value instanceof AST_Function) {
|
if (prop.value instanceof AST_Function && typeof Object.prototype[key] == "function") return this;
|
||||||
if (typeof Object.prototype[key] == "function") return this;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
val[key] = prop.value._eval(compressor, ignore_side_effects, cached, depth);
|
val[key] = prop.value._eval(compressor, ignore_side_effects, cached, depth);
|
||||||
if (val[key] === prop.value) return this;
|
if (val[key] === prop.value) return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3047,3 +3047,30 @@ issue_4214: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "NaN"
|
expect_stdout: "NaN"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4271: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
unsafe: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
({
|
||||||
|
p: null,
|
||||||
|
q: (console.log("foo"), 42),
|
||||||
|
p: function() {}
|
||||||
|
})[console.log("bar"), "p"] && console.log("PASS");
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
({
|
||||||
|
p: null,
|
||||||
|
q: (console.log("foo"), 42),
|
||||||
|
p: function() {}
|
||||||
|
})[console.log("bar"), "p"],
|
||||||
|
console.log("PASS");
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"foo",
|
||||||
|
"bar",
|
||||||
|
"PASS",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user