File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -746,6 +746,7 @@ jobs:
746
746
wasmfs.test_fs_llseek_rawfs
747
747
wasmfs.test_freetype
748
748
minimal0.test_utf
749
+ minimal0.test_static_variable
749
750
minimal0.test_stack_overflow
750
751
omitexports0.test_asyncify_longjmp
751
752
omitexports0.test_emscripten_api
Original file line number Diff line number Diff line change @@ -80,7 +80,26 @@ function run() {
80
80
_main ( { { { argc_argv( ) } } } ) . then ( exitRuntime ) ;
81
81
#elif EXIT_RUNTIME
82
82
// In regular exitRuntime mode, exit with the given return code from main().
83
- exitRuntime ( _main ( { { { argc_argv( ) } } } ) ) ;
83
+ try {
84
+ exitRuntime ( _main ( { { { argc_argv( ) } } } ) ) ;
85
+ } catch ( e ) {
86
+ var exitCode = e . match ( / ^ e x i t \( ( \d + ) \) $ / ) ;
87
+ if ( exitCode ) {
88
+ #if RUNTIME_DEBUG
89
+ dbg ( `main() called ${ e } .` ) ; // e.g. "main() called exit(0)."
90
+ #endif
91
+ #if expectToReceiveOnModule ( 'onExit' )
92
+ // Report to Module that the program exited.
93
+ Module [ 'onExit' ] ?. ( exitCode [ 1 ] | 0 ) ;
94
+ #endif
95
+ } else {
96
+ #if RUNTIME_DEBUG
97
+ dbg ( `main() threw an exception: ${ e } .` ) ;
98
+ #endif
99
+ // Some other exception occurred - re-throw it.
100
+ throw e ;
101
+ }
102
+ }
84
103
#else
85
104
// Run a persistent (never-exiting) application starting at main().
86
105
_main ( { { { argc_argv( ) } } } ) ;
You can’t perform that action at this time.
0 commit comments