JaroslavTulach commented on a change in pull request #2372:
URL: https://github.com/apache/netbeans/pull/2372#discussion_r490716341
##########
File path:
platform/api.scripting/test/unit/src/org/netbeans/api/scripting/JavaScriptEnginesTest.java
##########
@@ -256,7 +256,7 @@ public void allowLoadAClassInJS() throws Exception {
// BEGIN:
org.netbeans.api.scripting.JavaScriptEnginesTest#allowLoadAClassInJS
Object fn = engine.eval("(function(obj) {\n"
+ " var Long = Java.type('java.lang.Long');\n"
- + " return new Long(33);\n"
+ + " return new Long(\"33\");\n"
Review comment:
aa76809 seems to be a workaround. Requesting Nashorn compatibility mode
activates
[NASHORN_HOST_ACCESS](https://github.com/graalvm/graaljs/blob/vm-20.2.0/graal-js/src/com.oracle.truffle.js.scriptengine/src/com/oracle/truffle/js/scriptengine/GraalJSScriptEngine.java#L270)
which contains the Long ⇒ String
[conversion](https://github.com/graalvm/graaljs/commit/c09ae303ee6b7d9a1a470cade79b147c15ea6d46)
as identified by Samuel. By calling
```java
b.put("polyglot.js.allowHostAccess", true);
```
after that one replaces the Nashorn compatibility host access with
`HostAccess.ALL` switching back to the behavior of the engine as of GraalVM
19.3.x. CCing @iamstolis
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists