anchor.diff:  }
   
   class BitNotOperation implements UnaryOperation {
  +  @override
     final String name = '~';
  +
     const BitNotOperation();
   
  +  @override
     ConstantValue fold(ConstantValue constant) {
       if (isInt(constant)) {
         // In JavaScript we don't check for -0 and treat it as if it was zero.
  
positive.code: }
  
  class NegateOperation implements UnaryOperation {
    final String name = 'negate';
    const NegateOperation();
    ConstantValue fold(ConstantValue constant) {
      if (constant.isInt) {
        IntConstantValue intConstant = constant;
        return createInt(-intConstant.intValue);
      }
      if (constant.isDouble) {
        DoubleConstantValue doubleConstant = constant;
        return createDouble(-doubleConstant.doubleValue);
      }
      return null;
    }
  }
  
  class JavaScriptNegateOperation implements UnaryOperation {
    final NegateOperation dartNegateOperation = const NegateOperation();
  
    const JavaScriptNegateOperation();
  
    String get name => dartNegateOperation.name;
  
    ConstantValue fold(ConstantValue constant) {
      if (constant.isInt) {
        IntConstantValue intConstant = constant;
        if (intConstant.intValue == BigInt.zero) {
          return createDouble(-0.0);
        }
      }
      return dartNegateOperation.fold(constant);
    }
  }
  
  class NotOperation implements UnaryOperation {
    final String name = '!';
    const NotOperation();
    ConstantValue fold(ConstantValue constant) {
      if (constant.isBool) {
        BoolConstantValue boolConstant = constant;
  
negative.code: }
  
  class BooleanAndOperation extends BinaryBoolOperation {
    @override
    final String name = '&&';
  
    const BooleanAndOperation();
  
    @override
    bool foldBools(bool left, bool right) => left && right;
  
    @override
    apply(left, right) => left && right;
  }
  
  class BooleanOrOperation extends BinaryBoolOperation {
    @override
    final String name = '||';
  
    const BooleanOrOperation();
  
    @override
    bool foldBools(bool left, bool right) => left || right;
  
    @override
    apply(left, right) => left || right;
  }
  
  abstract class ArithmeticNumOperation implements BinaryOperation {
    const ArithmeticNumOperation();
  
    @override
    ConstantValue fold(ConstantValue left, ConstantValue right) {
      ConstantValue _fold(ConstantValue left, ConstantValue right) {
        if (left.isNum && right.isNum) {
          NumConstantValue leftNum = left;
          NumConstantValue rightNum = right;
          var foldedValue;
          if (left.isInt && right.isInt) {
            IntConstantValue leftInt = leftNum;
            IntConstantValue rightInt = rightNum;
            foldedValue = foldInts(leftInt.intValue, rightInt.intValue);
          } else {
            foldedValue = foldNums(leftNum.doubleValue, rightNum.doubleValue);
          }
          // A division by 0 means that we might not have a folded value.
          if (foldedValue == null) return null;
          if (left.isInt && right.isInt && !isDivide() || isTruncatingDivide()) {
            assert(foldedValue is BigInt);
            return createInt(foldedValue);
          } else {
            return createDouble(foldedValue);
          }
        }
        return null;
      }
  
      ConstantValue result = _fold(left, right);
      if (result == null) return result;
      return _convertToJavaScriptConstant(result);
    }
  
    bool isDivide() => false;
  