Ejemplo n.º 1
0
        public virtual bool HasInstance(ExecutionContext GLOBAL, object ob)
        {
            if (ob == null || ob is JSUndefined || ob is bool || ob is double || ob is string)
            {
                return(false);
            }
            object o = this.GetItem(GLOBAL, "prototype").GetValue(GLOBAL);

            if (o == null || o is JSUndefined || o is bool || o is double || o is string)
            {
                throw new TypeError(Class + " is not a progenitor in this case");
            }
            do
            {
                ob = JSObject.GetPrototype(GLOBAL, ob);
                if (o == ob)
                {
                    return(true);
                }
            }while (ob != null);
            return(false);
        }