fix AST_VarDef.may_throw() (#2580)
This commit is contained in:
@@ -2399,6 +2399,7 @@ merge(Compressor.prototype, {
|
|||||||
return this.expression.may_throw(compressor);
|
return this.expression.may_throw(compressor);
|
||||||
});
|
});
|
||||||
def(AST_VarDef, function(compressor){
|
def(AST_VarDef, function(compressor){
|
||||||
|
if (!this.value) return false;
|
||||||
return this.value.may_throw(compressor);
|
return this.value.may_throw(compressor);
|
||||||
});
|
});
|
||||||
})(function(node, func){
|
})(function(node, func){
|
||||||
|
|||||||
@@ -3785,3 +3785,23 @@ issue_2571_2: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "undefined"
|
expect_stdout: "undefined"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
may_throw: {
|
||||||
|
options = {
|
||||||
|
collapse_vars: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
function f() {
|
||||||
|
var a_2 = function() {
|
||||||
|
var a;
|
||||||
|
}();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
function f() {
|
||||||
|
var a_2 = function() {
|
||||||
|
var a;
|
||||||
|
}();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user