mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-05 17:29:43 +08:00
Fix 700090, 700094, 700095: Iterate through lists in AST analysis passes.
This commit is contained in:
16
jscompile.c
16
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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user