This commit is contained in:
Mihai Bazon
2012-08-27 11:00:26 +03:00
parent 4437e7af19
commit 8dfa9fe7e5
4 changed files with 17 additions and 10 deletions

View File

@@ -33,11 +33,17 @@ dead_code_2_should_warn: {
x = 10;
throw "foo";
// completely discarding the `if` would introduce some
// bugs. UglifyJS v1 doesn't deal with this issue.
// bugs. UglifyJS v1 doesn't deal with this issue; in v2
// we copy any declarations to the upper scope.
if (x) {
y();
var x;
function g(){};
// but nested declarations should not be kept.
(function(){
var q;
function y(){};
})();
}
}
}