diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-04-12 21:56:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-12 21:56:27 +0800 |
commit | 2244743545e8e5a75b4cce219605588cd29581b1 (patch) | |
tree | fc5b7077957e20489fada1b3388e39be2f958404 /lib/propmangle.js | |
parent | 04b89645058d85b8b67bb94fb9e39252160a0959 (diff) | |
download | tracifyjs-2244743545e8e5a75b4cce219605588cd29581b1.tar.gz tracifyjs-2244743545e8e5a75b4cce219605588cd29581b1.zip |
convert `AST_Seq` from binary tree to array (#1460)
- rename `AST_Seq` to `AST_Sequence`
- raise default sequences_limit from 200 to 800
Diffstat (limited to 'lib/propmangle.js')
-rw-r--r-- | lib/propmangle.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/propmangle.js b/lib/propmangle.js index b6222990..aaf5936f 100644 --- a/lib/propmangle.js +++ b/lib/propmangle.js @@ -224,8 +224,8 @@ function mangle_properties(ast, options) { try { (function walk(node){ node.walk(new TreeWalker(function(node){ - if (node instanceof AST_Seq) { - walk(node.cdr); + if (node instanceof AST_Sequence) { + walk(node.expressions[node.expressions.length - 1]); return true; } if (node instanceof AST_String) { @@ -247,8 +247,9 @@ function mangle_properties(ast, options) { function mangleStrings(node) { return node.transform(new TreeTransformer(function(node){ - if (node instanceof AST_Seq) { - node.cdr = mangleStrings(node.cdr); + if (node instanceof AST_Sequence) { + var last = node.expressions.length - 1; + node.expressions[last] = mangleStrings(node.expressions[last]); } else if (node instanceof AST_String) { node.value = mangle(node.value); |