diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -293,13 +293,13 @@ int main(int argc, char *argv[]) #endif #ifndef ZJS_SNAPSHOT_BUILD - code_eval = jerry_parse_named_resource((jerry_char_t *)file_name, - file_name_len, - (jerry_char_t *)script, - script_len, - false); + code_eval = jerry_parse((jerry_char_t *)file_name, + file_name_len, + (jerry_char_t *)script, + script_len, + JERRY_PARSE_NO_OPTS); - if (jerry_value_has_error_flag(code_eval)) { + if (jerry_value_is_error(code_eval)) { DBG_PRINT("Error parsing JS\n"); zjs_print_error_message(code_eval, ZJS_UNDEFINED); goto error; @@ -311,12 +311,16 @@ int main(int argc, char *argv[]) #endif #ifdef ZJS_SNAPSHOT_BUILD - result = jerry_exec_snapshot(snapshot_bytecode, snapshot_len, false); + result = jerry_exec_snapshot(snapshot_bytecode, + snapshot_len, + 0, + JERRY_SNAPSHOT_EXEC_COPY_DATA); + #else result = jerry_run(code_eval); #endif - if (jerry_value_has_error_flag(result)) { + if (jerry_value_is_error(result)) { DBG_PRINT("Error running JS\n"); zjs_print_error_message(result, ZJS_UNDEFINED); goto error; @@ -406,7 +410,7 @@ int main(int argc, char *argv[]) #ifdef BUILD_MODULE_PROMISE // run queued jobs for promises result = jerry_run_all_enqueued_jobs(); - if (jerry_value_has_error_flag(result)) { + if (jerry_value_is_error(result)) { DBG_PRINT("Error running JS in promise jobqueue\n"); zjs_print_error_message(result, ZJS_UNDEFINED); goto error; |