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
I'm trying to migrate a legacy Nashorn + Java 8 project to use GraalVM. As a first step, we are migrating to use GraalVM.js.
When migrating some scripts I found that some of our prints were throwing an exception. This exception happens when we have the following script.
functionfn(somePojo,someHashMap){print(''+somePojo.toString());// It works fineprint(''+someHashMap.toString());// It works fineprint(''+somePojo);// It works fineprint(''+someHashMap);// Throws org.graalvm.polyglot.PolyglotExceptionreturn'true';}
This is a sample code (https://github.com/vepo/graalvm-bug) that for testing. The same exception was thrown when running it with OpenJDK 8 and 20.
[WARNING]
javax.script.ScriptException: org.graalvm.polyglot.PolyglotException: TypeError: (this) has no such function "valueOf"
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.toScriptException (GraalJSScriptEngine.java:483)
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.invokeFunction (GraalJSScriptEngine.java:558)
at io.vepo.graalvmjs.GraalVmJsBug.main (GraalVmJsBug.java:52)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
at java.lang.Thread.run (Thread.java:1623)
Caused by: org.graalvm.polyglot.PolyglotException: TypeError: (this) has no such function "valueOf"
at <js>.fn (<eval>:5)
at org.graalvm.polyglot.Value.execute (Value.java:841)
at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.invokeFunction (GraalJSScriptEngine.java:556)
at io.vepo.graalvmjs.GraalVmJsBug.main (GraalVmJsBug.java:52)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:279)
at java.lang.Thread.run (Thread.java:1623)
The text was updated successfully, but these errors were encountered:
vepo
changed the title
PolyglotException when cocatenating String with map
PolyglotException when cocatenating String with HashMap
Apr 26, 2023
What version of GraalVM/graaljs do you use? I was able to reproduce this issue in some older GraalVM relase but your test-case works fine in the latest release (GraalVM 22.3.x) or with the latest development version.
I'm trying to migrate a legacy Nashorn + Java 8 project to use GraalVM. As a first step, we are migrating to use GraalVM.js.
When migrating some scripts I found that some of our prints were throwing an exception. This exception happens when we have the following script.
This is a sample code (https://github.com/vepo/graalvm-bug) that for testing. The same exception was thrown when running it with OpenJDK 8 and 20.
The text was updated successfully, but these errors were encountered: