aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 7dc2097..53a5c36 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;