From 2244743545e8e5a75b4cce219605588cd29581b1 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 12 Apr 2017 21:56:27 +0800 Subject: convert `AST_Seq` from binary tree to array (#1460) - rename `AST_Seq` to `AST_Sequence` - raise default sequences_limit from 200 to 800 --- lib/propmangle.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/propmangle.js') 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); -- cgit v1.2.3