aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-05 12:51:11 +0800
committerGitHub <noreply@github.com>2017-03-05 12:51:11 +0800
commit1f0333e9f146311e0e412fbd0783c0e1e63c7802 (patch)
tree8ad032bf7c16c7c89086331499a1c066407a2374 /lib/compress.js
parenteb98a7f2f38f5de16b50560199ee7ec719a1e945 (diff)
downloadtracifyjs-1f0333e9f146311e0e412fbd0783c0e1e63c7802.tar.gz
tracifyjs-1f0333e9f146311e0e412fbd0783c0e1e63c7802.zip
stay safe with constants in IE8- (#1547)
- `undefined` etc. can be redefined at top-level for IE8-, so disable related optimisations - fixed `--support-ie8` catch mangle bug
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 7eead2c1..4a5f6395 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3348,7 +3348,9 @@ merge(Compressor.prototype, {
return def;
}
// testing against !self.scope.uses_with first is an optimization
- if (self.undeclared() && !isLHS(self, compressor.parent())
+ if (compressor.option("screw_ie8")
+ && self.undeclared()
+ && !isLHS(self, compressor.parent())
&& (!self.scope.uses_with || !compressor.find_parent(AST_With))) {
switch (self.name) {
case "undefined":