You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, a bit info:
I am also trying to get web assembly to work using this dependency 'com.eclipsesource.j2v8:j2v8:6.2.0@aar'.
This version does have WebAssembly defined and it successfully instantiates the webassembly instance (I am using a webpack generated umd package that needs custom XMLHttpRequest implementation that actually loads the wasm bytes into memory and returns them as Uint8Array to v8 runtime).
So using that j2v8 version that would solve the "Error: WebAssembly is undefined" problem mentioned above.
But thats not all one needs to get the WebAssembly working using j2v8.
After loading the wasm we are given a promise that when resolved gives us the loaded wasm module.
But in order to allow for the wasm compilation we need to keep pumping the v8 main loop (check this for details: https://groups.google.com/g/v8-users/c/lRe7WrCkHCE)
Now my question to j2v8 people is this:
Why is the V8 class's method V8.pumpMessageLoop() non public ?
When I try to force the call via reflection I do get this exception:
PumpRuntime() Error: java.lang.reflect.InvocationTargetException
PumpRuntime() CAUSE: java.lang.UnsupportedOperationException: pumpMessageLoop Not Supported.
Do you need to build the v8 in any particular way to support message loop pumping?
Any light shed on this would be greatly appreciated!
I need to run WebAssembly codes in J2V8.
Still no support?
If yes, node can I get an example in java?
If not, is there any way around it?
`
V8 v8 = V8.createV8Runtime();
JavaVoidCallback successCallback = new JavaVoidCallback() {
@OverRide
public void invoke(V8Object v8Object, V8Array v8Array) {
System.out.println("[SUCESS] " + v8Array);
}
};
JavaVoidCallback errorCallback = new JavaVoidCallback() {
@OverRide
public void invoke(V8Object v8Object, V8Array v8Array) {
System.out.println("[ERROR] " + v8Array);
}
};
v8.registerJavaMethod(successCallback, "onSuccess");
v8.registerJavaMethod(errorCallback, "onError");
v8.executeScript(String.format("%s; executeAssembly('%s').then(onSuccess).catch(onError);", jsCode, hash)))
`
Error: WebAssembly is undefined
The text was updated successfully, but these errors were encountered: