Rhino.ScriptRuntime.ShallowEq C# (CSharp) Method

ShallowEq() public static method

public static ShallowEq ( object x, object y ) : bool
x object
y object
return bool
		public static bool ShallowEq(object x, object y)
		{
			if (x == y)
			{
				if (!(x is Number))
				{
					return true;
				}
				// NaN check
				double d = System.Convert.ToDouble(((Number)x));
				return d == d;
			}
			if (x == null || x == Undefined.instance)
			{
				return false;
			}
			else
			{
				if (x is Number)
				{
					if (y is Number)
					{
						return System.Convert.ToDouble(((Number)x)) == System.Convert.ToDouble(((Number)y));
					}
				}
				else
				{
					if (x is CharSequence)
					{
						if (y is CharSequence)
						{
							return x.ToString().Equals(y.ToString());
						}
					}
					else
					{
						if (x is bool)
						{
							if (y is bool)
							{
								return x.Equals(y);
							}
						}
						else
						{
							if (x is Scriptable)
							{
								if (x is Wrapper && y is Wrapper)
								{
									return ((Wrapper)x).Unwrap() == ((Wrapper)y).Unwrap();
								}
							}
							else
							{
								WarnAboutNonJSObject(x);
								return x == y;
							}
						}
					}
				}
			}
			return false;
		}
ScriptRuntime