dynamic callMethod(
String method,
[List args]
)

Calls method on the JavaScript object with the arguments args and returns the result.

The type of method must be either String or num.

Source

/**
 * Calls [method] on the JavaScript object with the arguments [args] and
 * returns the result.
 *
 * The type of [method] must be either [String] or [num].
 */
callMethod(String method, [List args]) {
  try {
    return _callMethod(method, args);
  } catch (e) {
    if (hasProperty(method)) {
      rethrow;
    } else {
      throw new NoSuchMethodError(this, new Symbol(method), args, null);
    }
  }
}