Browse Source

fix bug in handling variant 2 for statement with multiple variable declarations: comma wasn't eaten, resulting in syntax error

pull/1/head
Sami Vaarala 12 years ago
parent
commit
cdc291c25d
  1. 1
      src/duk_js_compiler.c

1
src/duk_js_compiler.c

@ -4001,6 +4001,7 @@ static void parse_for_statement(duk_compiler_ctx *comp_ctx, duk_ivalue *res, int
}
DUK_DDDPRINT("variant 2 has another variable initializer");
advance(comp_ctx); /* eat comma */
parse_variable_declaration(comp_ctx, res, EXPR_FLAG_REJECT_IN, &reg_varname, &reg_varbind);
}
goto parse_1_or_2;

Loading…
Cancel
Save