cast method

T cast(
  1. Object? o
)

Implementation

T cast(Object? o) {
  var jsObj = o.asJSObject;
  if (jsObj == null) throw ArgumentError("Can't cast `null` to type `$name`");
  return _cast(jsObj) ??
      (throw ArgumentError("Can't cast `$o` to type `$name`"));
}