fix corner case in global_defs (#3218)

fixes #3217
This commit is contained in:
Alex Lam S.L
2018-07-19 18:14:36 +08:00
committed by GitHub
parent cea685f8d9
commit 7cf72b8d66
3 changed files with 53 additions and 47 deletions

View File

@@ -142,7 +142,6 @@ mixed: {
}
expect_warnings: [
"WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:4,22]",
"WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:5,22]",
"WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:7,8]",
]
}
@@ -197,3 +196,23 @@ issue_2167: {
doWork();
}
}
issue_3217: {
options = {
collapse_vars: true,
global_defs: {
"@o": "{fn:function(){var a=42;console.log(a)}}",
},
inline: true,
properties: true,
reduce_vars: true,
side_effects: true,
unused: true,
}
input: {
o.fn();
}
expect: {
console.log(42);
}
}