Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix corner case in ie8 (#3890)
fixes #3889
  • Loading branch information
alexlamsl committed May 12, 2020
1 parent eb7fa25 commit 8024f7f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/compress.js
Expand Up @@ -399,6 +399,10 @@ merge(Compressor.prototype, {
}
});
};
if (compressor.option("ie8")) scope.variables.each(function(def) {
var d = def.orig[0].definition();
if (d !== def) d.fixed = false;
});
}

function mark_defun(tw, def) {
Expand Down
29 changes: 29 additions & 0 deletions test/compress/ie8.js
Expand Up @@ -2460,3 +2460,32 @@ issue_3825: {
}
expect_stdout: "undefined"
}

issue_3889: {
options = {
evaluate: true,
ie8: true,
reduce_vars: true,
}
input: {
function f(a) {
a = 0;
(function a() {
var a;
console.log(a);
})();
}
f();
}
expect: {
function f(a) {
a = 0;
(function a() {
var a;
console.log(a);
})();
}
f();
}
expect_stdout: "undefined"
}

0 comments on commit 8024f7f

Please sign in to comment.