public static object Equal(BinaryOpStorage/*!*/ compareStorage, object self, object other) {
if (self == other) {
return ScriptingRuntimeHelpers.True;
}
// calls method_missing:
var compare = compareStorage.GetCallSite("<=>");
object compareResult;
try {
compareResult = compare.Target(compare, self, other);
} catch (SystemException) {
// catches StandardError (like rescue)
return null;
}
if (compareResult == null || !(compareResult is int)) {
return null;
}
return ScriptingRuntimeHelpers.BooleanToObject((int)compareResult == 0);
}
}