@@ -389,7 +389,6 @@ void help(void)
389
389
" --exe select the executable to use as the base, defaults to the current one\n"
390
390
" --memory-limit n limit the memory usage to 'n' Kbytes\n"
391
391
" --stack-size n limit the stack size to 'n' Kbytes\n"
392
- " --unhandled-rejection dump unhandled promise rejections\n"
393
392
"-q --quit just instantiate the interpreter and quit\n" , JS_GetVersion ());
394
393
exit (1 );
395
394
}
@@ -414,7 +413,6 @@ int main(int argc, char **argv)
414
413
int empty_run = 0 ;
415
414
int module = -1 ;
416
415
int load_std = 0 ;
417
- int dump_unhandled_promise_rejection = 0 ;
418
416
char * include_list [32 ];
419
417
int i , include_count = 0 ;
420
418
int64_t memory_limit = -1 ;
@@ -514,10 +512,6 @@ int main(int argc, char **argv)
514
512
load_std = 1 ;
515
513
continue ;
516
514
}
517
- if (!strcmp (longopt , "unhandled-rejection" )) {
518
- dump_unhandled_promise_rejection = 1 ;
519
- continue ;
520
- }
521
515
if (opt == 'q' || !strcmp (longopt , "quit" )) {
522
516
empty_run ++ ;
523
517
continue ;
@@ -622,10 +616,8 @@ int main(int argc, char **argv)
622
616
/* loader for ES6 modules */
623
617
JS_SetModuleLoaderFunc (rt , NULL , js_module_loader , NULL );
624
618
625
- if (dump_unhandled_promise_rejection ) {
626
- JS_SetHostPromiseRejectionTracker (rt , js_std_promise_rejection_tracker ,
627
- NULL );
628
- }
619
+ /* exit on unhandled promise rejections */
620
+ JS_SetHostPromiseRejectionTracker (rt , js_std_promise_rejection_tracker , NULL );
629
621
630
622
if (!empty_run ) {
631
623
js_std_add_helpers (ctx , argc - optind , argv + optind );
0 commit comments