Skip to content

Passing interface with sub functions not working #59

@quarterware

Description

@quarterware

I need to pass an object a larger context as an interface with sub properties, but the sub properties are undefined when accessed inside a jailed environment. I read through this issue #58 and tried implementing that but it didn't work for what I needed.

This is what I originally tried

const context = {
    log: function(x) {
        console.log(x);
    },
    JSON: {
        stringify: function(x) {
            return JSON.stringify(x);
        }
    }
}

var dp = new DynamicPlugin(myCode, context);

This didn't work and returned undefined for JSON and it's sub function. I tried implementing the callback solution in #58 but it had the same issue. Am I doing something wrong or Jailed not able to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions