Skip to content

Tag: graaljs

Is there a way to use a java object as an argument for a function and return one of said objects’s values in GraalJS?

I want to use a Java object new Train() as an argument to pass into a JavaScript function, here is the Java code JavaScript code As of right now it puts this error in the console [16:56:42] [INFO]: [STDERR]: javax.script.ScriptException: org.graalvm.polyglot.PolyglotException: TypeError: invokeMember (getSpeed) on ScriptExecutor$Train@429b2a7b failed due to: Unknown identifier: getSpeed [16:56:42] [INFO]: [STDERR]: at [16:56:42] [INFO]: [STDERR]:

How to exit infinite JS execution loop when reading/loading Javascript in Java using GraalVM?

I found sandbox options as a way to set sandbox.MaxCPUTime in the graalVM documentation, to limit how long the thread runs – I’ve tried the following code – This has been failing for me with the error – Is there a better way to achieve this or a way I can make these sandbox options work? Answer You may