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
+32 -2
View File
@@ -218,7 +218,37 @@ function f22 (arguments, [a = arguments]) {
}
f22(3.1, []);
function f23(arguments, eval = () => eval()) {
try {
function f23(p = eval("var arguments"), arguments)
{
}
f23()
assert(false)
} catch (e) {
assert(e instanceof SyntaxError)
}
try {
function f24(p = eval("var arguments")) {
let arguments;
}
f24()
assert(false)
} catch (e) {
assert(e instanceof SyntaxError)
}
try {
function f25(p = eval("var arguments")) {
function arguments() { }
}
f25()
assert(false)
} catch (e) {
assert(e instanceof SyntaxError)
}
function f26(arguments, eval = () => eval()) {
assert(arguments === undefined);
}
f23(undefined);
f26(undefined);