Skip to content

Commit c046577

Browse files
Remove 'process_keyword_names' stage, as keyword literals now can be registered during main parse stage.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
1 parent d7ecd4a commit c046577

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

jerry-core/parser/js/parser.cpp

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ static void parse_statement (jsp_label_t *outermost_stmt_label_p);
6767
static operand parse_assignment_expression (bool);
6868
static void parse_source_element_list (bool);
6969
static operand parse_argument_list (varg_list_type, operand, uint8_t *, operand *);
70-
static void process_keyword_names (void);
7170
static void skip_braces (void);
7271
static void skip_parens (void);
7372

@@ -2566,50 +2565,6 @@ skip_optional_name_and_parens (void)
25662565
}
25672566
}
25682567

2569-
static void process_keyword_names ()
2570-
{
2571-
if (token_is (TOK_KEYWORD))
2572-
{
2573-
keyword kw = (keyword) token_data ();
2574-
skip_newlines ();
2575-
if (token_is (TOK_COLON))
2576-
{
2577-
const char *s = lexer_keyword_to_string (kw);
2578-
lit_find_or_create_literal_from_charset ((const ecma_char_t *) s, (ecma_length_t) strlen (s));
2579-
}
2580-
else
2581-
{
2582-
lexer_save_token (tok);
2583-
}
2584-
}
2585-
else if (token_is (TOK_NAME))
2586-
{
2587-
if (lit_literal_equal_type_zt (lit_get_literal_by_cp (token_data_as_lit_cp ()), (const ecma_char_t *) "get")
2588-
|| lit_literal_equal_type_zt (lit_get_literal_by_cp (token_data_as_lit_cp ()), (const ecma_char_t *) "set"))
2589-
{
2590-
skip_newlines ();
2591-
if (token_is (TOK_KEYWORD))
2592-
{
2593-
keyword kw = (keyword) token_data ();
2594-
skip_newlines ();
2595-
if (token_is (TOK_OPEN_PAREN))
2596-
{
2597-
const char *s = lexer_keyword_to_string (kw);
2598-
lit_find_or_create_literal_from_charset ((const ecma_char_t *) s, (ecma_length_t) strlen (s));
2599-
}
2600-
else
2601-
{
2602-
lexer_save_token (tok);
2603-
}
2604-
}
2605-
else
2606-
{
2607-
lexer_save_token (tok);
2608-
}
2609-
}
2610-
}
2611-
}
2612-
26132568
static void
26142569
skip_braces (void)
26152570
{
@@ -2627,10 +2582,6 @@ skip_braces (void)
26272582
{
26282583
nesting_level--;
26292584
}
2630-
else
2631-
{
2632-
process_keyword_names ();
2633-
}
26342585
}
26352586
}
26362587

@@ -2805,8 +2756,6 @@ preparse_scope (bool is_global)
28052756
is_ref_eval_identifier = true;
28062757
}
28072758
}
2808-
2809-
process_keyword_names ();
28102759
}
28112760
skip_newlines ();
28122761
}

0 commit comments

Comments
 (0)