mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Dump 'use strict' prior to reg_var_decl.
This commit is contained in:
parent
90dfee3cdb
commit
d5878132cc
2
.gitignore
vendored
2
.gitignore
vendored
@ -33,6 +33,8 @@ vgcore.*
|
||||
**.orig
|
||||
**.directory
|
||||
**.patch
|
||||
.tags*
|
||||
cscope.*
|
||||
|
||||
# ctags and ID database
|
||||
tags
|
||||
|
||||
@ -3955,19 +3955,19 @@ preparse_scope (bool is_global)
|
||||
{
|
||||
STACK_DECLARE_USAGE (locs);
|
||||
STACK_DECLARE_USAGE (U8)
|
||||
STACK_DECLARE_USAGE (U16)
|
||||
|
||||
STACK_PUSH (locs, TOK ().loc);
|
||||
STACK_PUSH (U8, is_global ? TOK_EOF : TOK_CLOSE_BRACE);
|
||||
|
||||
STACK_PUSH (U16, OPCODE_COUNTER ());
|
||||
|
||||
if (token_is (TOK_STRING) && lp_string_equal_s (lexer_get_string_by_id (token_data ()), "use strict"))
|
||||
{
|
||||
scopes_tree_set_strict_mode (STACK_TOP (scopes), true);
|
||||
DUMP_OPCODE_3 (meta, OPCODE_META_TYPE_STRICT_CODE, INVALID_VALUE, INVALID_VALUE);
|
||||
}
|
||||
|
||||
STACK_PUSH (U16, OPCODE_COUNTER ());
|
||||
DUMP_OPCODE_2 (reg_var_decl, MIN_TEMP_NAME (), INVALID_VALUE);
|
||||
|
||||
while (!token_is (STACK_TOP (U8)))
|
||||
{
|
||||
if (is_keyword (KW_VAR))
|
||||
@ -4001,10 +4001,8 @@ preparse_scope (bool is_global)
|
||||
lexer_seek (STACK_TOP (locs));
|
||||
STACK_DROP (locs, 1);
|
||||
STACK_DROP (U8, 1);
|
||||
STACK_DROP (U16, 1);
|
||||
|
||||
STACK_CHECK_USAGE (U8);
|
||||
STACK_CHECK_USAGE (U16);
|
||||
STACK_CHECK_USAGE (locs);
|
||||
}
|
||||
|
||||
@ -4020,9 +4018,6 @@ parse_source_element_list (bool is_global)
|
||||
STACK_DECLARE_USAGE (temp_names)
|
||||
|
||||
start_new_scope ();
|
||||
STACK_PUSH (U16, OPCODE_COUNTER ());
|
||||
DUMP_OPCODE_2 (reg_var_decl, MIN_TEMP_NAME (), INVALID_VALUE);
|
||||
|
||||
preparse_scope (is_global);
|
||||
|
||||
skip_newlines ();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user