mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-14 08:29:32 +00:00
runtime: avoid heap allocs for plain errors
This commit is contained in:
@@ -66,9 +66,9 @@ var initializeCalled bool
|
||||
func wasmExportCheckRun() {
|
||||
switch {
|
||||
case !initializeCalled:
|
||||
runtimePanic("//go:wasmexport function called before runtime initialization")
|
||||
runtimePanic(errWasmBeforeInit)
|
||||
case mainExited:
|
||||
runtimePanic("//go:wasmexport function called after main.main returned")
|
||||
runtimePanic(errWasmAfterMain)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,6 @@ func wasmExportCheckRun() {
|
||||
func wasmExportRun(done *bool) {
|
||||
scheduler(true)
|
||||
if !*done {
|
||||
runtimePanic("//go:wasmexport function did not finish")
|
||||
runtimePanic(errWasmDidNotFinish)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user