@@ -293,13 +293,13 @@ int main(int argc, char *argv[])
293293#endif
294294
295295#ifndef ZJS_SNAPSHOT_BUILD
296- code_eval = jerry_parse_named_resource ((jerry_char_t * )file_name ,
297- file_name_len ,
298- (jerry_char_t * )script ,
299- script_len ,
300- false );
296+ code_eval = jerry_parse ((jerry_char_t * )file_name ,
297+ file_name_len ,
298+ (jerry_char_t * )script ,
299+ script_len ,
300+ JERRY_PARSE_NO_OPTS );
301301
302- if (jerry_value_has_error_flag (code_eval )) {
302+ if (jerry_value_is_error (code_eval )) {
303303 DBG_PRINT ("Error parsing JS\n" );
304304 zjs_print_error_message (code_eval , ZJS_UNDEFINED );
305305 goto error ;
@@ -311,12 +311,16 @@ int main(int argc, char *argv[])
311311#endif
312312
313313#ifdef ZJS_SNAPSHOT_BUILD
314- result = jerry_exec_snapshot (snapshot_bytecode , snapshot_len , false);
314+ result = jerry_exec_snapshot (snapshot_bytecode ,
315+ snapshot_len ,
316+ 0 ,
317+ JERRY_SNAPSHOT_EXEC_COPY_DATA );
318+
315319#else
316320 result = jerry_run (code_eval );
317321#endif
318322
319- if (jerry_value_has_error_flag (result )) {
323+ if (jerry_value_is_error (result )) {
320324 DBG_PRINT ("Error running JS\n" );
321325 zjs_print_error_message (result , ZJS_UNDEFINED );
322326 goto error ;
@@ -406,7 +410,7 @@ int main(int argc, char *argv[])
406410#ifdef BUILD_MODULE_PROMISE
407411 // run queued jobs for promises
408412 result = jerry_run_all_enqueued_jobs ();
409- if (jerry_value_has_error_flag (result )) {
413+ if (jerry_value_is_error (result )) {
410414 DBG_PRINT ("Error running JS in promise jobqueue\n" );
411415 zjs_print_error_message (result , ZJS_UNDEFINED );
412416 goto error ;
0 commit comments