Catch paramter must not be scanned as function in ES5.1 (#3618)

Fixes #3554

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-03-17 13:06:59 +01:00
committed by GitHub
parent 7ea93aff4c
commit 1cfda262bd
3 changed files with 55 additions and 5 deletions
+14 -5
View File
@@ -553,17 +553,26 @@ scanner_pop_literal_pool (parser_context_t *context_p, /**< context */
no_declarations++;
if (type & SCANNER_LITERAL_IS_FUNC)
{
no_declarations++;
}
if (no_reg || (type & no_reg_types))
{
type |= SCANNER_LITERAL_NO_REG;
literal_p->type = type;
}
if (type & SCANNER_LITERAL_IS_FUNC)
{
no_declarations++;
#if !ENABLED (JERRY_ES2015)
if (type & SCANNER_LITERAL_IS_LOCAL)
{
/* Catch parameters cannot be functions. */
literal_p->type = (uint8_t) (type & ~SCANNER_LITERAL_IS_FUNC);
no_declarations--;
}
#endif /* !ENABLED (JERRY_ES2015) */
}
intptr_t diff = (intptr_t) (literal_p->char_p - prev_source_p);
if (diff >= 1 && diff <= UINT8_MAX)