aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 85bb0910..fe504164 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3279,7 +3279,12 @@ merge(Compressor.prototype, {
});
def(AST_Assign, function(compressor){
var left = this.left;
- if (left.has_side_effects(compressor)) return this;
+ if (left.has_side_effects(compressor)
+ || compressor.has_directive("use strict")
+ && left instanceof AST_PropAccess
+ && left.expression.is_constant()) {
+ return this;
+ }
this.write_only = true;
while (left instanceof AST_PropAccess) {
left = left.expression;