anchor.diff:  
     /**
      * Returns the least upper bound between [firstType] and
  -   * [secondType]. TODO(ngeoffray): Use TypeMask.union.
  +   * [secondType].
      */
     TypeMask computeLUB(TypeMask firstType, TypeMask secondType) {
  -    bool isNumber(type) {
  -      return type == numType || type == doubleType || type == intType;
  -    }
       assert(secondType != null);
       if (firstType == null) {
         return secondType;
       } else if (isGiveUpType(firstType)) {
         return firstType;
  +    } else if (isGiveUpType(secondType)) {
  +      return secondType;
       } else if (isDynamicType(secondType)) {
         return secondType;
       } else if (isDynamicType(firstType)) {
         return firstType;
  -    } else if (firstType != secondType) {
  -      if (isNumber(firstType) && isNumber(secondType)) {
  -        // The JavaScript backend knows how to deal with numbers.
  -        return numType;
  -      }
  -      // TODO(ngeoffray): Actually compute the least upper bound.
  -      return giveUpType;
  +    } else if (firstType == nullType) {
  +      return secondType.nullable();
  +    } else if (secondType == nullType) {
  +      return firstType.nullable();
       } else {
  -      assert(firstType == secondType);
  -      return firstType;
  +      TypeMask union = firstType.union(secondType, compiler);
  +      return union == null ? giveUpType : union;
       }
     }
   }
  
positive.code:           mappedType = inferrer.numType;
          } else if (type.element == compiler.boolClass) {
            mappedType = inferrer.boolType;
          } else if (compiler.world.hasAnySubclass(type.element)) {
            mappedType = new TypeMask.nonNullSubclass(
                inferrer.rawTypeOf(type.element));
  
negative.code:           mappedType = new TypeMask.nonNullExact(
                inferrer.rawTypeOf(type.element));
          }
          returnType = inferrer.computeLUB(returnType, mappedType);
        }
        return returnType;
      } else if (name == const SourceString('JS_OPERATOR_IS_PREFIX')
  