fix a couple of bugs in global_defs (#1802)

- `optimize()` substituted expression
- compute nested property string correctly

fixes #1801

Miscellaneous
- reset optimisation flags on all node types
This commit is contained in:
Alex Lam S.L
2017-04-08 16:46:25 +08:00
committed by GitHub
parent cf72fe552f
commit 0479ff0c54
2 changed files with 20 additions and 7 deletions

View File

@@ -145,3 +145,18 @@ mixed: {
'WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:129,8]',
]
}
issue_1801: {
options = {
booleans: true,
global_defs: {
"CONFIG.FOO.BAR": true,
},
}
input: {
console.log(CONFIG.FOO.BAR);
}
expect: {
console.log(!0);
}
}