Add support for graalvm style Java.type() function #84
Replies: 2 comments
-
just saw @caoccao latest post on a different issue oracle/graaljs#2 (comment) and it addresses the above:
so that seems to answer it, no problems just the obvious security implications |
Beta Was this translation helpful? Give feedback.
-
Congratulations. I'm glad that you figured out how to simply resolve that. Javet gives you all kind of ways on defining your own DSL, even simulating GraalJS. That's also the general guideline in Javet design: Javet avoids defining an official way of how to inject Java objects, instead Javet teaches people how to define their own ways in a few lines of code. |
Beta Was this translation helpful? Give feedback.
-
The following seems to work and would allow a script to create any class with the same syntax as graalvm with Java.type(String s). Then you don't have to know ahead of time which classes to inject into the v8Runtime global object.
Are there any issues anyone can see with this approach?
index.js
main.java
Java.java
Beta Was this translation helpful? Give feedback.
All reactions