Fix redeclaration related eval corner cases (#4886)

- Fix cases where a function parameter binding is redeclared inside a parameter initializer eval
- Fix cases where a let- or function arguments binding is redeclared inside a function block because
  there is a declaration in a function parameter initializer eval
- Also remove the ECMA_PARSE_CHAIN_INDEX_SHIFT macro, added a debugger_eval_chain_index named field to the jerry context instead

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2021-12-15 12:45:10 +01:00
committed by GitHub
parent 768a209544
commit d650390e47
8 changed files with 158 additions and 191 deletions
+2 -1
View File
@@ -540,7 +540,8 @@ jerry_debugger_send_eval (const lit_utf8_byte_t *eval_string_p, /**< evaluated s
uint32_t chain_index;
memcpy (&chain_index, eval_string_p, sizeof (uint32_t));
uint32_t parse_opts = ECMA_PARSE_DIRECT_EVAL | (chain_index << ECMA_PARSE_CHAIN_INDEX_SHIFT);
uint32_t parse_opts = ECMA_PARSE_DIRECT_EVAL;
JERRY_CONTEXT (debugger_eval_chain_index) = (uint16_t) chain_index;
parser_source_char_t source_char;
source_char.source_p = eval_string_p + 5;