convert AST_Seq from binary tree to array (#1460)

- rename `AST_Seq` to `AST_Sequence`
- raise default sequences_limit from 200 to 800
This commit is contained in:
Alex Lam S.L
2017-04-12 21:56:27 +08:00
committed by GitHub
parent 04b8964505
commit 2244743545
14 changed files with 376 additions and 307 deletions

View File

@@ -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);