@@ -435,10 +435,6 @@ parse_argument_list (varg_list_type vlt, operand obj, uint8_t *args_count, opera
435
435
{
436
436
case VARG_FUNC_DECL:
437
437
case VARG_FUNC_EXPR:
438
- {
439
- syntax_start_checking_of_vargs ();
440
- /* FALLTHRU */
441
- }
442
438
case VARG_CONSTRUCT_EXPR:
443
439
{
444
440
current_token_must_be (TOK_OPEN_PAREN);
@@ -590,7 +586,6 @@ parse_argument_list (varg_list_type vlt, operand obj, uint8_t *args_count, opera
590
586
case VARG_FUNC_DECL:
591
587
case VARG_FUNC_EXPR:
592
588
{
593
- syntax_check_for_syntax_errors_in_formal_param_list (is_strict_mode (), tok.loc );
594
589
res = rewrite_varg_header_set_args_count (args_num);
595
590
break ;
596
591
}
@@ -638,6 +633,8 @@ parse_function_declaration (void)
638
633
serializer_set_scope (STACK_TOP (scopes));
639
634
scopes_tree_set_strict_mode (STACK_TOP (scopes), scopes_tree_strict_mode (STACK_HEAD (scopes, 2 )));
640
635
lexer_set_strict_mode (scopes_tree_strict_mode (STACK_TOP (scopes)));
636
+
637
+ syntax_start_checking_of_vargs ();
641
638
parse_argument_list (VARG_FUNC_DECL, name, NULL , NULL );
642
639
643
640
dump_function_end_for_rewrite ();
@@ -657,6 +654,8 @@ parse_function_declaration (void)
657
654
658
655
inside_function = was_in_function;
659
656
657
+ syntax_check_for_syntax_errors_in_formal_param_list (is_strict_mode (), tok.loc );
658
+
660
659
STACK_DROP (scopes, 1 );
661
660
serializer_set_scope (STACK_TOP (scopes));
662
661
lexer_set_strict_mode (scopes_tree_strict_mode (STACK_TOP (scopes)));
@@ -676,6 +675,8 @@ parse_function_expression (void)
676
675
677
676
operand res;
678
677
678
+ syntax_start_checking_of_vargs ();
679
+
679
680
skip_newlines ();
680
681
if (token_is (TOK_NAME))
681
682
{
@@ -714,6 +715,8 @@ parse_function_expression (void)
714
715
715
716
inside_function = was_in_function;
716
717
718
+ syntax_check_for_syntax_errors_in_formal_param_list (is_strict_mode (), tok.loc );
719
+
717
720
return res;
718
721
}
719
722
0 commit comments