graal-js - passing JS native object to Java - com.oracle.truffle.object.enterprise.b
Adam McMahon
adam at cs.miami.edu
Tue Jan 9 01:53:22 UTC 2018
Hi,
Here is the snippet of code I am working on. It passes a native JS object
to Java. https://gist.github.com/AdamMcM/87bed21323aa5ff90ed020412f16eb02
The org.graalvm.polyglot.Value class seems promising to be able to inspect
natvie JS objects passed to Java, but I am not sure how to obtain a
org.graalvm.polyglot.Value object from the native JS object passed to Java.
>> We're currently reworking the value conversions so that
language objects are always exposed as wrapper objects that Java code
can work with, e.g. implementing java.util.Map (similar to
ScriptObjectMirror).
This sounds like it will work well.
-Adam
On Mon, Jan 8, 2018 at 4:59 PM, Thomas Wuerthinger <
thomas.wuerthinger at oracle.com> wrote:
> Hi Adam!
>
> The only class you should ever have to work with is in that context is
> org.graalvm.polyglot.Value (see javadoc at http://graalvm.github.io/
> graal/truffle/javadoc/index.html?org/graalvm/polyglot/Value.html). We are
> not exposing implementation-internal classes but instead have this
> language-agnostic Value interface abstraction. Can you share your code
> snippet?
>
> Thanks, thomas
>
>
> > On 08.01.2018, at 22:32, Adam McMahon <adam at cs.miami.edu> wrote:
> >
> > Hi,
> >
> > I am attempting to get a few nashorn projects working with graal.js.
> Often
> > we need to pass native JS objects back to Java. In nashorn, this would
> be
> > passed back to Java as a jdk.nashorn.api.scripting.ScriptObjectMirror.
> >
> > Using Graal-js it seems to be passed back as a
> > com.oracle.truffle.object.enterprise.b. Is the actual name of this
> class
> > really just "b" (perhaps for "bindings")?
> >
> > Do you happen to have a link to javadoc for this class? Or any other
> info?
> >
> > Thanks,
> >
> > -Adam
>
>
More information about the graal-dev
mailing list