wasm gc: support JSExceptions.getJSException

This commit is contained in:
Alexey Andreev 2025-02-08 16:03:09 +01:00
parent da848c523b
commit bdc9fe757a
2 changed files with 6 additions and 1 deletions

View File

@ -549,6 +549,10 @@ function jsoImports(imports, context) {
},
concatArray: (a, b) => [...a, ...b],
getJavaException: e => e[javaExceptionSymbol],
getJSException: e => {
let getJsException = context.exports["teavm.getJsException"]
return getJsException(e);
},
jsExports: () => context.userExports
};
for (let name of ["wrapByte", "wrapShort", "wrapChar", "wrapInt", "wrapLong", "wrapFloat", "wrapDouble",

View File

@ -24,5 +24,6 @@ public final class JSExceptions {
@Import(name = "getJavaException", module = "teavmJso")
public static native Throwable getJavaException(JSObject e);
public static native JSObject getJSException(Throwable e);
@Import(name = "getJSException", module = "teavmJso")
public static native JSObject su(Throwable e);
}