예제 #1
0
        public IObj Construct(double num)
        {
            var obj = new ValueObj(num);

            obj.Class = ObjClass.Number;
            obj.Prototype = Number_prototype;
            obj.Context = Context;

            return obj;
        }
예제 #2
0
        public IObj Construct(bool bol)
        {
            var obj = new ValueObj(bol);

            obj.Class = ObjClass.Boolean;
            obj.Prototype = Boolean_prototype;
            obj.Context = Context;

            return obj;
        }
예제 #3
0
        public IObj Construct(string value)
        {
            var obj = new ValueObj(value);

            obj.Class = ObjClass.String;
            obj.Prototype = String_prototype;
            obj.Context = Context;
            obj.SetOwnProperty("length", (double)value.Length);

            return obj;
        }
예제 #4
0
        public IObj Construct(object[] args)
        {
            var bol = args != null && args.Length > 0 ? JsTypeConverter.ToBoolean(args[0]) : false;
            var obj = new ValueObj(bol);

            obj.Class = ObjClass.Boolean;
            obj.Prototype = Boolean_prototype;
            obj.Context = Context;

            return obj;
        }
예제 #5
0
        public IObj Construct(object[] args)
        {
            var num = args != null && args.Length > 0 ? JsTypeConverter.ToNumber(args[0]) : 0.0D;
            var obj = new ValueObj(num);

            obj.Class = ObjClass.Number;
            obj.Prototype = Number_prototype;
            obj.Context = Context;

            return obj;
        }
예제 #6
0
        public IObj Construct(object[] args)
        {
            var str = args != null && args.Length > 0 ? JsTypeConverter.ToString(args[0]) : "";
            var obj = new ValueObj(str);

            obj.Class = ObjClass.String;
            obj.Prototype = String_prototype;
            obj.Context = Context;
            obj.SetOwnProperty("length", (double) str.Length);

            return obj;
        }