call method
Call as a JS function object.
Implementation
dynamic call([List argv = const []]) {
assert(!_disposed);
int len = argv.length;
if (len > MAX_ARGUMENTS - 2) {
throw Exception("The arguments are too many ${MAX_ARGUMENTS - 3}");
}
script._arguments[0].setValue(this);
script._arguments[1].setInt(argv.length);
for (int i = 0, t = len; i < t; ++i) {
script._arguments[i + 2].set(argv[i], script);
}
return script._action(JS_ACTION_CALL, 2 + len,
block: (results, length) => results[0].get(script)
);
}