Delay the variable construction in the function body. (#3289)

Local variables inside the function body should be constructed after the
parameters are initialized. Furthermore arguments should be available
during parameter initialization.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2019-11-08 12:18:23 +01:00
committed by Dániel Bátyai
parent 923fd128b5
commit e1fc90db0e
7 changed files with 223 additions and 92 deletions
+2 -8
View File
@@ -175,14 +175,6 @@ typedef enum
SCANNER_FUNCTION_ARGUMENTS_NEEDED = (1 << 0), /**< arguments object needs to be created */
} scanner_function_flags_t;
/**
* Scanner info for function statements.
*/
typedef struct
{
scanner_info_t info; /**< header */
} scanner_function_info_t;
/**
* Option bits for scanner_create_variables function.
*/
@@ -190,6 +182,8 @@ typedef enum
{
SCANNER_CREATE_VARS_NO_OPTS = 0, /**< no options */
SCANNER_CREATE_VARS_IS_EVAL = (1 << 0), /**< create variables for script / direct eval */
SCANNER_CREATE_VARS_IS_FUNCTION_ARGS = (1 << 1), /**< create variables for function arguments */
SCANNER_CREATE_VARS_IS_FUNCTION_BODY = (1 << 2), /**< create variables for function body */
} scanner_create_variables_flags_t;
/**