예제 #1
0
        protected IObj CreatePrototype()
        {
            var obj = new Obj();

            obj.Class = ObjClass.Object;
            obj.Prototype = null;
            obj.Context = Context;
            obj.SetOwnProperty("constructor", this);
            obj.SetOwnProperty("toString", new Object_prototype_toString(Context));
            obj.SetOwnProperty("valueOf", new Object_prototype_valueOf(Context));
            obj.SetOwnProperty("hasOwnProperty", new Object_prototype_hasOwnProperty(Context));
            obj.SetOwnProperty("isPrototypeOf", new Object_prototype_isPrototypeOf(Context));
            obj.SetOwnProperty("propertyIsEnumerable", new Object_prototype_propertyIsEnumerable(Context));
            obj.SetOwnProperty("toLocaleString", new Object_prototype_toLocaleString(Context));

            return obj;
        }
예제 #2
0
        public Obj CreateObject()
        {
            var obj = new Obj();

            obj.Context = this;
            obj.Class = ObjClass.Object;

            return obj;
        }