public int HashCode(object obj)
{
if (obj == null)
throw ErrorFactory.CreateTypeError("Invalid operand type: 'null'");
if (obj is BikeObject)
{
var lbo = (BikeObject)obj;
if (lbo.Exist("hash_code") || lbo.Exist (InterpreterHelper.MemberMissing))
{
var hc = lbo.Resolve("hash_code");
if (hc is BikeFunction)
{
return (int)((BikeNumber)CallBikeFunction(
(BikeFunction)hc, lbo, new object[0])).Value;
}
throw ErrorFactory.CreateTypeError("hash_code is not a function");
}
throw ErrorFactory.CreateNotDefinedError("hash_code");
}
return obj.GetHashCode();
}