public BikeBoolean OpEqual(object lv, object rv)
{
if (lv == null)
return new BikeBoolean(rv == null);
if (lv is BikeObject)
{
var lbo = (BikeObject) lv;
if (lbo.Exist("==") || lbo.Exist (InterpreterHelper.MemberMissing))
{
var eq = lbo.Resolve("==");
if (eq is BikeFunction)
{
return (BikeBoolean) CallBikeFunction(
(BikeFunction)eq, lbo, new[] { rv });
}
throw ErrorFactory.CreateTypeError("== is not a function");
}
return new BikeBoolean(lbo == rv);
}
return new BikeBoolean(lv.Equals(rv));
}