From 2de49cdba7cfb504e06111aa4b4fdf4fefd12ef5 Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Fri, 5 Jun 2015 18:46:25 +0300 Subject: [PATCH] Fix of 'case' / 'default' statements skip during parse of SwitchStatement. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com --- jerry-core/parser/js/parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jerry-core/parser/js/parser.cpp b/jerry-core/parser/js/parser.cpp index 2728de90a..0032eb1d1 100644 --- a/jerry-core/parser/js/parser.cpp +++ b/jerry-core/parser/js/parser.cpp @@ -2038,13 +2038,15 @@ parse_with_statement (void) static void skip_case_clause_body (void) { - while (!is_keyword (KW_CASE) && !is_keyword (KW_DEFAULT) && !token_is (TOK_CLOSE_BRACE)) + while (!is_keyword (KW_CASE) + && !is_keyword (KW_DEFAULT) + && !token_is (TOK_CLOSE_BRACE)) { - skip_newlines (); if (token_is (TOK_OPEN_BRACE)) { skip_braces (); } + skip_newlines (); } }