code: private static Expression doEqualsString(SoyExpression stringExpr, SoyExpression other) {
      // This is compatible with SharedRuntime.compareString, which interestingly makes == break
      // transitivity.  See b/21461181
      SoyRuntimeType otherRuntimeType = other.soyRuntimeType();
      if (otherRuntimeType.isKnownStringOrSanitizedContent()) {
        if (stringExpr.isNonNullable()) {
          return stringExpr.invoke(MethodRef.EQUALS, other.unboxAsString());
        } else {
          return MethodRef.OBJECTS_EQUALS.invoke(stringExpr, other.unboxAsString());
        }
      }
      if (otherRuntimeType.isKnownNumber() && other.isNonNullable()) {
        // in this case, we actually try to convert stringExpr to a number
        return MethodRef.RUNTIME_STRING_EQUALS_AS_NUMBER.invoke(stringExpr, other.coerceToDouble());
      }
      // We don't know what other is, assume the worst and call out to our boxed implementation for
      // string comparisons.
      return MethodRef.RUNTIME_COMPARE_NULLABLE_STRING.invoke(stringExpr, other.box());
    }
docs: Compare a string valued expression to another expression using soy == semantics.
  
  @param stringExpr An expression that is known to be an unboxed string
  @param other An expression to compare it to.