if (def) {
return def.optimize(compressor);
}
+ if (is_lhs(self, compressor.parent())) return self;
if (compressor.option("unsafe_proto")
&& self.expression instanceof AST_Dot
&& self.expression.property == "prototype") {
break;
}
}
- if (is_lhs(self, compressor.parent())) return self;
var sub = self.flatten_object(self.property, compressor);
if (sub) return sub.optimize(compressor);
var ev = self.evaluate(compressor);
}
}
+native_prototype_lhs: {
+ options = {
+ unsafe_proto: true,
+ }
+ input: {
+ console.log(function() {
+ Function.prototype.bar = "PASS";
+ return function() {};
+ }().bar);
+ }
+ expect: {
+ console.log(function() {
+ Function.prototype.bar = "PASS";
+ return function() {};
+ }().bar);
+ }
+ expect_stdout: "PASS"
+}
+
accessor_boolean: {
input: {
var a = 1;