Parse functions directly (#2015)

This patch adds direct function source code parsing, which
is useful to avoid source code duplications. The patch
also improves the Function constructor.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2017-09-21 11:03:23 +02:00
committed by Dániel Bátyai
parent 7713d30702
commit 8d916a44f1
11 changed files with 427 additions and 244 deletions
+6 -2
View File
@@ -479,7 +479,9 @@ jerry_parse_and_save_snapshot (const jerry_char_t *source_p, /**< script source
JMEM_ALIGNMENT);
globals.snapshot_error_occured = false;
parse_status = parser_parse_script (source_p,
parse_status = parser_parse_script (NULL,
0,
source_p,
source_size,
is_strict,
&bytecode_data_p);
@@ -900,7 +902,9 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source
#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
ecma_value_t parse_status;
ecma_compiled_code_t *bytecode_data_p;
parse_status = parser_parse_script (source_p,
parse_status = parser_parse_script (NULL,
0,
source_p,
source_size,
is_strict,
&bytecode_data_p);