You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jt...@apache.org on 2019/04/02 07:52:58 UTC
[incubator-netbeans-html4j] branch master updated: Allowing
Graal.js RC15 to access the java classes
This is an automated email from the ASF dual-hosted git repository.
jtulach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans-html4j.git
The following commit(s) were added to refs/heads/master by this push:
new 32c69d4 Allowing Graal.js RC15 to access the java classes
32c69d4 is described below
commit 32c69d4f5fbf9c21e821b1b8c6a07985c26cc2f1
Author: Jaroslav Tulach <ja...@apidesign.org>
AuthorDate: Tue Apr 2 09:52:40 2019 +0200
Allowing Graal.js RC15 to access the java classes
---
boot/src/test/java/org/netbeans/html/boot/impl/JsUtils.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/boot/src/test/java/org/netbeans/html/boot/impl/JsUtils.java b/boot/src/test/java/org/netbeans/html/boot/impl/JsUtils.java
index 1a732f1..961ae33 100644
--- a/boot/src/test/java/org/netbeans/html/boot/impl/JsUtils.java
+++ b/boot/src/test/java/org/netbeans/html/boot/impl/JsUtils.java
@@ -18,7 +18,9 @@
*/
package org.netbeans.html.boot.impl;
+import javax.script.Bindings;
import javax.script.Invocable;
+import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
@@ -26,6 +28,8 @@ final class JsUtils {
public static ScriptEngine initializeEngine() throws Exception {
ScriptEngineManager sem = new ScriptEngineManager();
final ScriptEngine eng = sem.getEngineByMimeType("text/javascript");
+ Bindings bindings = eng.getBindings(ScriptContext.ENGINE_SCOPE);
+ bindings.put("polyglot.js.allowHostAccess", true); // NOI18N
eng.eval("function checkArray(arr, to) {\n"
+ " if (to === null) {\n"
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists