fix crash in unsafe replacement of undefined

remove extraneous call to AST_SymbolRef.reference()

closes #1443
This commit is contained in:
alexlamsl
2017-02-18 18:58:23 +08:00
parent dd31d12a91
commit 11676f9d72
2 changed files with 70 additions and 3 deletions

View File

@@ -0,0 +1,69 @@
// tests assume that variable `undefined` not redefined and has `void 0` as value
unsafe_undefined: {
options = {
if_return: true,
unsafe: true
}
mangle = {}
input: {
function f(undefined) {
return function() {
if (a)
return b;
if (c)
return d;
};
}
}
expect: {
function f(n) {
return function() {
if (a)
return b;
if (c)
return d;
else
return n;
};
}
}
}
keep_fnames: {
options = {
if_return: true,
unsafe: true
}
mangle = {
keep_fnames: true
}
input: {
function f(undefined) {
return function() {
function n(a) {
return a * a;
}
if (a)
return b;
if (c)
return d;
};
}
}
expect: {
function f(r) {
return function() {
function n(n) {
return n * n;
}
if (a)
return b;
if (c)
return d;
else
return r;
};
}
}
}