Fix function argument handling issues caused by the parser. (#3705)

1) Nested function declarations should not overwrite arguments.
2) Functions should be created in the correct scope.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-05-04 14:55:46 +02:00
committed by GitHub
parent 40a9f27314
commit 132a2008c9
6 changed files with 135 additions and 23 deletions
+7 -5
View File
@@ -3224,11 +3224,6 @@ scan_completed:
JERRY_DEBUG_MSG (" LOCAL ");
break;
}
case SCANNER_STREAM_TYPE_DESTRUCTURED_ARG:
{
JERRY_DEBUG_MSG (" DESTRUCTURED_ARG ");
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
case SCANNER_STREAM_TYPE_IMPORT:
@@ -3242,6 +3237,13 @@ scan_completed:
JERRY_DEBUG_MSG (" ARG ");
break;
}
#if ENABLED (JERRY_ES2015)
case SCANNER_STREAM_TYPE_DESTRUCTURED_ARG:
{
JERRY_DEBUG_MSG (" DESTRUCTURED_ARG ");
break;
}
#endif /* ENABLED (JERRY_ES2015) */
case SCANNER_STREAM_TYPE_ARG_FUNC:
{
JERRY_DEBUG_MSG (" ARG_FUNC ");