$ es4x versions
VM: OpenJDK 64-Bit Server VM - 17
VM Vendor: null
Vert.x: 4.2.2
ES4X: 0.16.2
graaljs: 21.3.0
code: index.js
import { Promise as VPromise } from "@vertx/core";
let promise = VPromise.promise();
promise.future().then(v => {
console.log("v:" + v);
return "v2";
});
setTimeout(() => {
promise.complete("v1");
}, 1000);
error message:
Failed in deploying verticle caused by TypeError: invokeMember (then) on io.vertx.core.impl.future.PromiseImpl@47ddaaf5 failed due to: Arity error - expected: 2 actual: 1
at <js> :anonymous(/C:/Users/fan/Desktop/test/demo/index.js:9-12:204-274)
at <js> _load(node_modules\.lib\es4x-0.16.2.jar!\io\reactiverse\es4x\jvm-npm.js:73:2195-2276)
at <js> runMain(node_modules\.lib\es4x-0.16.2.jar!\io\reactiverse\es4x\jvm-npm.js:85:2567-2611)
at org.graalvm.sdk/org.graalvm.polyglot.Value.invokeMember(Value.java:934)
at io.reactiverse.es4x.impl.JSVerticleFactory$1.lambda$start$0(JSVerticleFactory.java:85)
at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:159)
at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:157)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
code: index.js
error message:
I found that 'then' must have two parameters.
The following code executes normally.