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