We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e39e965 commit 6d60a12Copy full SHA for 6d60a12
lib/wasm/wasm_exec.js
@@ -556,7 +556,17 @@
556
if (this.exited) {
557
throw new Error("Go program has already exited");
558
}
559
- this._inst.exports.resume();
+ try {
560
+ this._inst.exports.resume();
561
+ } catch (err) {
562
+ if (err instanceof RangeError) {
563
+ // runtime.throw
564
+ this._inst.exports.throw(err.message);
565
+ this.exited = true;
566
+ this._resolveExitPromise();
567
+ throw err;
568
+ }
569
570
571
this._resolveExitPromise();
572
src/runtime/panic.go
@@ -1086,6 +1086,7 @@ func internal_sync_fatal(s string) {
1086
// See go.dev/issue/67401.
1087
//
1088
//go:linkname throw
1089
+//go:wasmexport throw
1090
//go:nosplit
1091
func throw(s string) {
1092
// Everything throw does should be recursively nosplit so it
0 commit comments