Fix named function expression creation. (#2634)

Create a local lexical environment with the name of the function. While
this is not too memory efficient, some corner cases requires its existence.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-12-12 12:50:03 +01:00
committed by Akos Kiss
parent 4f0b075f85
commit 83ee9cfca3
11 changed files with 182 additions and 147 deletions
+1 -1
View File
@@ -413,7 +413,7 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
if (name_p->status_flags & LEXER_FLAG_INITIALIZED)
{
if (!(name_p->status_flags & (LEXER_FLAG_FUNCTION_NAME | LEXER_FLAG_FUNCTION_ARGUMENT)))
if (!(name_p->status_flags & LEXER_FLAG_FUNCTION_ARGUMENT))
{
/* Overwrite the previous initialization. */
ecma_compiled_code_t *compiled_code_p;