public static boolean equal ( SoyValue operand0 , SoyValue operand1 ) { // Treat the case where either is a string specially. // TODO(gboyer): This should probably handle SanitizedContent == SanitizedContent, even though // Javascript doesn't handle that case properly. http://b/21461181 if ( operand0 instanceof StringData || operand0 instanceof UnsanitizedString ) { return compareString ( operand0 . stringValue ( ) , operand1 ) ; } if ( operand1 instanceof StringData || operand1 instanceof UnsanitizedString ) { return compareString ( operand1 . stringValue ( ) , operand0 ) ; } return Objects . equals ( operand0 , operand1 ) ; }
Custom equality operator that smooths out differences between different Soy runtimes .