parse @global_defs as expressions (#2169)

- let parser rejects non-conformant input
- eliminate need for extraneous parenthesis
This commit is contained in:
Alex Lam S.L
2017-06-27 10:31:19 +08:00
committed by GitHub
parent 8b4dcd8f3e
commit 1e4de2e6d3
3 changed files with 25 additions and 7 deletions

View File

@@ -174,3 +174,24 @@ issue_1986: {
console.log(42);
}
}
issue_2167: {
options = {
conditionals: true,
dead_code: true,
evaluate: true,
global_defs: {
"@isDevMode": "function(){}",
},
side_effects: true,
}
input: {
if (isDevMode()) {
greetOverlord();
}
doWork();
}
expect: {
doWork();
}
}