A JavaScript implementation that runs on GraalVM. See tags "javascript" and "graalvm". Use this tag for questions regarding running JavaScript code using GraalJS.
Questions tagged [graaljs]
67 questions
0
votes
1 answer
Accessing JavaScript array through Java with graal.js
I am migrating a project from Nashorn to graal.js. The project utilizes a large amount of scripts (over 3,400) and there's a function on the Java side which invokes a method; the method returns a JavaScript list of objects.
function…

shavit
- 842
- 1
- 7
- 17
0
votes
1 answer
GraalVM Polyglot can't load Java class
Want migrate from Nashorn to GraalVM. Installed Graal VM CE
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-jvmci-19.3-b05-LTS)
OpenJDK 64-Bit GraalVM CE 19.3.0 (build 11.0.5+10-jvmci-19.3-b05-LTS, mixed mode,…

Woland
- 623
- 2
- 13
- 31
0
votes
1 answer
Equivalent of Nashorn's importPackage in graal.js script engine
I am migrating old code from JDK 8 to JDK 12.
In the process, I have noticed importPackage does not exist when using the "graal.js" script engine. It exists when using "javascript" for the script engine.
Is there any way to achieve the same…

shavit
- 842
- 1
- 7
- 17
0
votes
3 answers
How can I pass a Map from Java to graal.js?
I have a Map in Scala/Java I want to be visible in Javascript running on graal.js engine.
case class Thing() {
def foo() { println("FOO!") } // just to see if this is callable from js (it is)
val m = Map("foo" -> "bar", "one" -> 1)
val d1 =…

Greg
- 10,696
- 22
- 68
- 98
0
votes
1 answer
what host object to use for javascript event handlers
I want to allow JavaScript to register events, with a syntax like
object.on('eventName', (event) => {
event.something();
});
The event object provides different methods depending on what 'eventName' is (depending on what type of event I'd like to…

theonlygusti
- 11,032
- 11
- 64
- 119
-1
votes
1 answer
How to call javascript function making a axios api call from java
I have a javascript function which make a network call using the axios library.
The function supports for GET and POST.
My requirement is to call the same javascript function from Java, which internally will make a network call using axios.

Rahul
- 1
-1
votes
1 answer
Graal-js is throwing File system provider error
I am trying to run simple code -
Added all the dependencies as mentioned in this document :https://github.com/graalvm/graal-js-jdk11-maven-demo/blob/master/pom.xml
ScriptEngine graaljsEngine = new…

Aishwarya Patil
- 49
- 1
- 6