Rhino.BaseFunction.HasInstance C# (CSharp) Method

HasInstance() public method

Implements the instanceof operator for JavaScript Function objects.
Implements the instanceof operator for JavaScript Function objects.

foo = new Foo();
foo instanceof Foo; // true

public HasInstance ( Scriptable instance ) : bool
instance Scriptable /// The value that appeared on the LHS of the instanceof /// operator ///
return bool
		public override bool HasInstance(Scriptable instance)
		{
			object protoProp = ScriptableObject.GetProperty(this, "prototype");
			if (protoProp is Scriptable)
			{
				return ScriptRuntime.JsDelegatesTo(instance, (Scriptable)protoProp);
			}
			throw ScriptRuntime.TypeError1("msg.instanceof.bad.prototype", GetFunctionName());
		}