I'm not sure what is going on, but the promise then/catch is not working.
Weirdly it was working at some point then seems to have stopped.
If i put breakpoints within the functions they don't stop either, like they are never being called.
running on graalvm-jdk-22, kotlin 2.0.10 & kotlin.test
@Test
fun `Graalvm promise execution`() {
val context = Context
.newBuilder("js")
.allowAllAccess(true)
.allowHostAccess(HostAccess.ALL)
.allowIO(IOAccess.ALL)
.build()
context
.eval("js", "async function render(x) { return x }")
val response = context
.getBindings("js")
.getMember("render")
.execute(10)
println(response)
val then = response
.invokeMember("then", { value: Value ->
println(value)
})
.invokeMember("catch", { value: Value ->
println(value)
})
println(then)
}
I'm not sure what is going on, but the promise then/catch is not working. Weirdly it was working at some point then seems to have stopped. If i put breakpoints within the functions they don't stop either, like they are never being called.
running on
graalvm-jdk-22
,kotlin 2.0.10
&kotlin.test
Output: