File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 545
545
throw new Error ( "total length of command line and environment variables exceeds limit" ) ;
546
546
}
547
547
548
- this . _inst . exports . run ( argc , argv ) ;
548
+ this . _runCatch ( ( ) => this . _inst . exports . run ( argc , argv ) ) ;
549
549
if ( this . exited ) {
550
550
this . _resolveExitPromise ( ) ;
551
551
}
552
552
await this . _exitPromise ;
553
553
}
554
554
555
- _resume ( ) {
556
- if ( this . exited ) {
557
- throw new Error ( "Go program has already exited" ) ;
558
- }
555
+ _runCatch ( fn ) {
559
556
try {
560
- this . _inst . exports . resume ( ) ;
557
+ fn ( ) ;
561
558
} catch ( err ) {
562
559
if ( err instanceof RangeError ) {
563
560
// runtime.throw
567
564
throw err ;
568
565
}
569
566
}
567
+ }
568
+
569
+ _resume ( ) {
570
+ if ( this . exited ) {
571
+ throw new Error ( "Go program has already exited" ) ;
572
+ }
573
+
574
+ this . _runCatch ( ( ) => this . _inst . exports . resume ( ) ) ;
575
+
570
576
if ( this . exited ) {
571
577
this . _resolveExitPromise ( ) ;
572
578
}
You can’t perform that action at this time.
0 commit comments