Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Getting PolyglotMap Object type Returned When Using GraalVM in Java Instead My Own Proxy Object Type #44

@shaharzillber

Description

@shaharzillber

I'm currently working with GraalVM in Java and encountering an issue with the object type returned by a function. Here's the code snippet:

import com.oracle.truffle.js.scriptengine.GraalJSScriptEngine;
import org.graalvm.polyglot.HostAccess;
import org.graalvm.polyglot.Value;

myRunFunction(myOwnObject input) {
    myOwnProxyObject finalInput = new myOwnProxyObject(input);
    Object result;
    try {
        result = Engine.invokeFunction(myJSCode, finalInput, context, logger, data, anotherData);
    } catch(Exception e){
        //do something
    }

//do other
}

The problem is that the result object is of type polygloMtap instead of the expected myOwnProxyObject.
Can anyone help me understand why this is happening and how I can ensure the function returns an object of type myOwnProxyObject? Any help would be greatly appreciated.

Here's what I've attempted so far:
Initially, I was working with the object type myOwnObject. However, after conducting some research, I realized that this approach might not be the most efficient. Despite this, I still received an object of type myOwnObject.
This led me to suspect that there might be an issue with the implementation of myOwnProxyObject. However, I'm currently unsure of what the specific problem could be. I'm looking for guidance on what could potentially be wrong with my myOwnProxyObject implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions