aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/compress.js b/lib/compress.js
index dc453f14..e70af436 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1816,11 +1816,12 @@ merge(Compressor.prototype, {
}
if (prop instanceof AST_Node) break;
prop = "" + prop;
- if (compressor.has_directive("use strict")) {
- if (!all(def.value.properties, function(node) {
- return node.key != prop && node.key.name != prop;
- })) break;
- }
+ var diff = compressor.has_directive("use strict") ? function(node) {
+ return node.key != prop && node.key.name != prop;
+ } : function(node) {
+ return node.key.name != prop;
+ };
+ if (!all(def.value.properties, diff)) break;
def.value.properties.push(make_node(AST_ObjectKeyVal, node, {
key: prop,
value: node.right