[Wasm] Pass js stack value directly when replacing a wasm exception with JS one

In this case, we don't need to convert a value to and from wasm String.
This commit is contained in:
Zalim Bashorov
2023-04-17 14:38:19 +02:00
committed by Space Team
parent 6bfd1e7e9f
commit 521a272acb
6 changed files with 11 additions and 11 deletions
@@ -6,7 +6,7 @@
package kotlin.wasm.internal
@Suppress("UNUSED_PARAMETER") // TODO: Remove after bootstrap update
private fun throwJsError(message: String?, wasmTypeName: String?, stack: String): Nothing {
private fun throwJsError(message: String?, wasmTypeName: String?, stack: ExternalInterfaceType): Nothing {
js("""
const error = new Error();
error.message = message;
@@ -17,7 +17,7 @@ private fun throwJsError(message: String?, wasmTypeName: String?, stack: String)
}
internal fun throwAsJsException(t: Throwable): Nothing {
throwJsError(t.message, getSimpleName(t.typeInfo), t.stack)
throwJsError(t.message, getSimpleName(t.typeInfo), t.jsStack)
}
internal var isNotFirstWasmExportCall: Boolean = false