compress undefined property names (#2811)

- enforce property names as string
- handle `void 0` as `undefined` in `hoist_props` & `reduce_vars`
This commit is contained in:
Alex Lam S.L
2018-01-19 00:36:30 +08:00
committed by GitHub
parent 983e69128b
commit 082e004b87
6 changed files with 46 additions and 16 deletions

View File

@@ -1365,7 +1365,7 @@ function parse($TEXT, options) {
if (type == "name" && !is("punc", ":")) {
var key = new AST_SymbolAccessor({
start: S.token,
name: as_property_name(),
name: "" + as_property_name(),
end: prev()
});
if (name == "get") {
@@ -1391,7 +1391,7 @@ function parse($TEXT, options) {
a.push(new AST_ObjectKeyVal({
start : start,
quote : start.quote,
key : name,
key : "" + name,
value : expression(false),
end : prev()
}));