anchor.diff:  })()''');
   
   /// Returns true if [ft1] <: [ft2].
  -_isFunctionSubtype(ft1, ft2, @notNull bool strictMode) => JS('', '''(() => {
  +@notNull
  +bool _isFunctionSubtype(ft1, ft2, @notNull bool strictMode) =>
  +    JS<bool>('!', '''(() => {
     let ret1 = $ft1.returnType;
     let ret2 = $ft2.returnType;
   
  
positive.code:     // JavaScriptObject <: package:js types
      // package:js types <: JavaScriptObject
  
      if (${_isInterfaceSubtype(t1, JavaScriptObject, strictMode)}
          &&
              // TODO: Since package:js types are instances of PackageJSType and
              // we don't have a mechanism to determine if *some* package:js type
              // implements t2. This will possibly require keeping a map of these
              // relationships for this subtyping check. For now, this will only
              // work if t2 is also a PackageJSType.
              ${_isInterfaceSubtype(_pkgJSTypeForSubtyping, t2, strictMode)}) {
        return true;
      }
  
      if (${_isInterfaceSubtype(JavaScriptObject, t2, strictMode)}
          && ${_isInterfaceSubtype(t1, _pkgJSTypeForSubtyping, strictMode)}) {
        return true;
      }
  
      // Compare two interface types.
      return ${_isInterfaceSubtype(t1, t2, strictMode)};
    }
  
    // Function subtyping.
    if (!${_jsInstanceOf(t1, AbstractFunctionType)}) {
      return false;
    }
  
    // Handle generic functions.
    if (${_jsInstanceOf(t1, GenericFunctionType)}) {
      if (!${_jsInstanceOf(t2, GenericFunctionType)}) {
        return false;
      }
  
  
negative.code:     // instantiated with the same ones. The instantiate operation is guaranteed
      // to avoid capture because it does not depend on its TypeVariable objects,
      // rather it uses JS function parameters to ensure correct binding.
      var fresh = JS<GenericFunctionType>('!', '#', t2).typeFormals;
  
      // Without type bounds all will instantiate to dynamic. Only need to check
      // further if at least one of the functions has type bounds.
      if (JS<bool>('!', '#.hasTypeBounds || #.hasTypeBounds', t1, t2)) {
        // Check the bounds of the type parameters of g1 and g2. Given a type
        // parameter `T1 extends U1` from g1, and a type parameter `T2 extends U2`
        // from g2, we must ensure that U1 and U2 are mutual subtypes.
        //
        // (Note there is no variance in the type bounds of type parameters of
        // generic functions).
        var t1Bounds =
            JS<GenericFunctionType>('!', '#', t1).instantiateTypeBounds(fresh);
        var t2Bounds =
            JS<GenericFunctionType>('!', '#', t2).instantiateTypeBounds(fresh);
        for (var i = 0; i < formalCount; i++) {
          var t1Bound = JS('!', '#[#]', t1Bounds, i);
          var t2Bound = JS('!', '#[#]', t2Bounds, i);
          if (JS<bool>('!', '# != #', t1Bound, t2Bound)) {
            if (!(_isSubtype(t1Bound, t2Bound, strictMode) &&
                _isSubtype(t2Bound, t1Bound, strictMode))) {
              return false;
            }
          }
        }
      }
  
      t1 = JS<GenericFunctionType>('!', '#', t1).instantiate(fresh);
      t2 = JS<GenericFunctionType>('!', '#', t2).instantiate(fresh);
    } else if (_jsInstanceOf(t2, GenericFunctionType)) {
      return false;
    }
  
    // Handle non-generic functions.
    return _isFunctionSubtype(t1, t2, strictMode);
  }
  
  @notNull
  bool _isInterfaceSubtype(t1, t2, @notNull bool strictMode) => JS('', '''(() => {
    // Instances of PackageJSType are all subtypes of each other.
    if (${_jsInstanceOf(t1, PackageJSType)}
  