support call function name
guzishiwo opened this issue · 1 comments
guzishiwo commented
Can support loading js with multiple functions and then calling the specified function name?
final js = """
function a() {}
function b() {}
function c() {}
""";
final jsInvokable = engine.evaluate(js);
jsInvokable.invoke("a", [])
ekibun commented
You can return an object that contains the functions and get from map
final js = """
({
a: function () {},
b: function () {},
c: function () {},
})
""";
final ret = engine.evaluate(js);
ret["a"].invoke([])