diff --git a/jscompile.c b/jscompile.c index 325d1b2..9531b99 100644 --- a/jscompile.c +++ b/jscompile.c @@ -1221,6 +1221,14 @@ static void cstmlist(JF, js_Ast *list) static void analyze(JF, js_Ast *node) { + if (node->type == AST_LIST) { + while (node) { + analyze(J, F, node->a); + node = node->b; + } + return; + } + if (isfun(node->type)) { F->lightweight = 0; return; /* don't scan inner functions */ @@ -1277,6 +1285,14 @@ static int cparams(JF, js_Ast *list, js_Ast *fname) static void cvardecs(JF, js_Ast *node) { + if (node->type == AST_LIST) { + while (node) { + cvardecs(J, F, node->a); + node = node->b; + } + return; + } + if (isfun(node->type)) return; /* stop at inner functions */ diff --git a/jsparse.c b/jsparse.c index 1f46024..4182885 100644 --- a/jsparse.c +++ b/jsparse.c @@ -942,6 +942,14 @@ static int jsP_foldconst(js_Ast *node) double x, y; int a, b; + if (node->type == AST_LIST) { + while (node) { + jsP_foldconst(node->a); + node = node->b; + } + return 0; + } + if (node->type == EXP_NUMBER) return 1;