covariant method

  1. @override
bool covariant(
  1. dynamic x
)
override

Assert that JavaScript's x is the proper type represented by this Type.

Implementation

@override
bool covariant(dynamic x) {
  return (x is Map &&
      _fields.every((entry) {
        var k = entry.key;
        var t = entry.value;

        if (!x.containsKey(k)) {
          throw "Record is missing key '$k'.";
        }
        return t.covariant(x[k]);
      }));
}