aboutsummaryrefslogtreecommitdiff
path: root/lib/parse.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-01-19 00:36:30 +0800
committerGitHub <noreply@github.com>2018-01-19 00:36:30 +0800
commit082e004b872ecb158e5a28702898688742b5da86 (patch)
tree81b5183f9f108c64680d106c0d51af43c4751e5a /lib/parse.js
parent983e69128b0e6da78d71ad9b77d798f31a10ca44 (diff)
downloadtracifyjs-082e004b872ecb158e5a28702898688742b5da86.tar.gz
tracifyjs-082e004b872ecb158e5a28702898688742b5da86.zip
compress `undefined` property names (#2811)
- enforce property names as string - handle `void 0` as `undefined` in `hoist_props` & `reduce_vars`
Diffstat (limited to 'lib/parse.js')
-rw-r--r--lib/parse.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/parse.js b/lib/parse.js
index eba833dc..af631149 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -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()
}));