Inheritance: DateObject
Ejemplo n.º 1
0
 internal DateConstructor(LenientFunctionPrototype parent, LenientDatePrototype prototypeProp)
   : base(parent, "Date", 7) {
   this.originalPrototype = prototypeProp;
   prototypeProp.constructor = this;
   this.proto = prototypeProp;
   this.noExpando = false;
 }
 internal DateConstructor(LenientFunctionPrototype parent, LenientDatePrototype prototypeProp) : base(parent, "Date", 7)
 {
     this.originalPrototype    = prototypeProp;
     prototypeProp.constructor = this;
     base.proto     = prototypeProp;
     base.noExpando = false;
 }
Ejemplo n.º 3
0
 internal DateConstructor()
     : base(FunctionPrototype.ob, "Date", 7)
 {
     this.originalPrototype     = DatePrototype.ob;
     DatePrototype._constructor = this;
     this.proto = DatePrototype.ob;
 }
 internal override Object GetDefaultValue(PreferredType preferred_type)
 {
     if (this.GetParent() is LenientDatePrototype)
     {
         return(base.GetDefaultValue(preferred_type));
     }
     if (preferred_type == PreferredType.String || preferred_type == PreferredType.Either)
     {
         if (!this.noExpando)
         {
             Object field = this.NameTable["toString"];
             if (field != null)
             {
                 return(base.GetDefaultValue(preferred_type));
             }
         }
         return(DatePrototype.toString(this));
     }
     else if (preferred_type == PreferredType.LocaleString)
     {
         if (!this.noExpando)
         {
             Object field = this.NameTable["toLocaleString"];
             if (field != null)
             {
                 return(base.GetDefaultValue(preferred_type));
             }
         }
         return(DatePrototype.toLocaleString(this));
     }
     else
     {
         if (!this.noExpando)
         {
             Object field = this.NameTable["valueOf"];
             if (field == null && preferred_type == PreferredType.Either)
             {
                 field = this.NameTable["toString"];
             }
             if (field != null)
             {
                 return(base.GetDefaultValue(preferred_type));
             }
         }
         return(this.value);
     }
 }
Ejemplo n.º 5
0
        public new DateObject CreateInstance(params Object[] args)
        {
            if (args.Length == 0)
            {
                return(new DateObject(this.originalPrototype, DateTime.Now.ToUniversalTime().Ticks / DatePrototype.ticksPerMillisecond - DatePrototype.msTo1970));
            }
            if (args.Length == 1)
            {
                Object       arg0  = args[0];
                IConvertible ic    = Convert.GetIConvertible(arg0);
                TypeCode     tcode = Convert.GetTypeCode(arg0, ic);
                if (tcode == TypeCode.DateTime)
                {
                    return(new DateObject(this.originalPrototype, ic.ToDateTime(null).ToUniversalTime().Ticks / DatePrototype.ticksPerMillisecond - DatePrototype.msTo1970));
                }
                Object yv = Convert.ToPrimitive(arg0, PreferredType.Either, ref ic);
                if (Convert.GetTypeCode(yv, ic) == TypeCode.String)
                {
                    return(new DateObject(this.originalPrototype, parse(ic.ToString(null))));
                }
                double d = Convert.ToNumber(yv, ic);
                if (DatePrototype.minDate <= d && d <= DatePrototype.maxDate)
                {
                    return(new DateObject(this.originalPrototype, d));
                }
                return(new DateObject(this.originalPrototype, Double.NaN));
            }
            double dyear    = Convert.ToNumber(args[0]);
            double dmonth   = Convert.ToNumber(args[1]);
            double ddate    = (args.Length > 2) ? Convert.ToNumber(args[2]) : 1;
            double dhours   = (args.Length > 3) ? Convert.ToNumber(args[3]) : 0;
            double dminutes = (args.Length > 4) ? Convert.ToNumber(args[4]) : 0;
            double dseconds = (args.Length > 5) ? Convert.ToNumber(args[5]) : 0;
            double dms      = (args.Length > 6) ? Convert.ToNumber(args[6]) : 0;
            int    y        = (int)dyear;

            if (!Double.IsNaN(dyear) && 0 <= y && y <= 99)
            {
                dyear = y + 1900;
            }
            double day  = DatePrototype.MakeDay(dyear, dmonth, ddate);
            double time = DatePrototype.MakeTime(dhours, dminutes, dseconds, dms);

            return(new DateObject(this.originalPrototype, DatePrototype.TimeClip(DatePrototype.UTC(DatePrototype.MakeDate(day, time)))));
        }
        public DateObject CreateInstance(params object[] args)
        {
            if (args.Length == 0)
            {
                return(new DateObject(this.originalPrototype, (((double)DateTime.Now.ToUniversalTime().Ticks) / 10000.0) - 62135596800000));
            }
            if (args.Length == 1)
            {
                object       ob           = args[0];
                IConvertible iConvertible = Microsoft.JScript.Convert.GetIConvertible(ob);
                if (Microsoft.JScript.Convert.GetTypeCode(ob, iConvertible) == TypeCode.DateTime)
                {
                    return(new DateObject(this.originalPrototype, (((double)iConvertible.ToDateTime(null).ToUniversalTime().Ticks) / 10000.0) - 62135596800000));
                }
                object obj3 = Microsoft.JScript.Convert.ToPrimitive(ob, PreferredType.Either, ref iConvertible);
                if (Microsoft.JScript.Convert.GetTypeCode(obj3, iConvertible) == TypeCode.String)
                {
                    return(new DateObject(this.originalPrototype, parse(iConvertible.ToString(null))));
                }
                double num = Microsoft.JScript.Convert.ToNumber(obj3, iConvertible);
                if ((-8.64E+15 <= num) && (num <= 8.64E+15))
                {
                    return(new DateObject(this.originalPrototype, num));
                }
                return(new DateObject(this.originalPrototype, double.NaN));
            }
            double val   = Microsoft.JScript.Convert.ToNumber(args[0]);
            double month = Microsoft.JScript.Convert.ToNumber(args[1]);
            double date  = (args.Length > 2) ? Microsoft.JScript.Convert.ToNumber(args[2]) : 1.0;
            double hour  = (args.Length > 3) ? Microsoft.JScript.Convert.ToNumber(args[3]) : 0.0;
            double min   = (args.Length > 4) ? Microsoft.JScript.Convert.ToNumber(args[4]) : 0.0;
            double sec   = (args.Length > 5) ? Microsoft.JScript.Convert.ToNumber(args[5]) : 0.0;
            double ms    = (args.Length > 6) ? Microsoft.JScript.Convert.ToNumber(args[6]) : 0.0;
            int    num9  = (int)Runtime.DoubleToInt64(val);

            if ((!double.IsNaN(val) && (0 <= num9)) && (num9 <= 0x63))
            {
                val = num9 + 0x76c;
            }
            double day  = DatePrototype.MakeDay(val, month, date);
            double time = DatePrototype.MakeTime(hour, min, sec, ms);

            return(new DateObject(this.originalPrototype, DatePrototype.TimeClip(DatePrototype.UTC(DatePrototype.MakeDate(day, time)))));
        }
Ejemplo n.º 7
0
        public static double UTC(Object year, Object month, Object date, Object hours, Object minutes, Object seconds, Object ms)
        {
            if (year is Missing)
            {
                return(DateTime.Now.ToUniversalTime().Ticks / DatePrototype.ticksPerMillisecond - DatePrototype.msTo1970);
            }
            double dyear    = Convert.ToNumber(year);
            double dmonth   = month   is Missing ? 0 : Convert.ToNumber(month);
            double ddate    = date    is Missing ? 1 : Convert.ToNumber(date);
            double dhours   = hours   is Missing ? 0 : Convert.ToNumber(hours);
            double dminutes = minutes is Missing ? 0 : Convert.ToNumber(minutes);
            double dseconds = seconds is Missing ? 0 : Convert.ToNumber(seconds);
            double dms      = ms      is Missing ? 0 : Convert.ToNumber(ms);
            int    y        = (int)dyear;

            if (!Double.IsNaN(dyear) && 0 <= y && y <= 99)
            {
                dyear = y + 1900;
            }
            double day  = DatePrototype.MakeDay(dyear, dmonth, ddate);
            double time = DatePrototype.MakeTime(dhours, dminutes, dseconds, dms);

            return(DatePrototype.TimeClip(DatePrototype.MakeDate(day, time)));
        }
 internal override object GetDefaultValue(PreferredType preferred_type)
 {
     if (base.GetParent() is LenientDatePrototype)
     {
         return(base.GetDefaultValue(preferred_type));
     }
     if ((preferred_type == PreferredType.String) || (preferred_type == PreferredType.Either))
     {
         if (!base.noExpando && (base.NameTable["toString"] != null))
         {
             return(base.GetDefaultValue(preferred_type));
         }
         return(DatePrototype.toString(this));
     }
     if (preferred_type == PreferredType.LocaleString)
     {
         if (!base.noExpando && (base.NameTable["toLocaleString"] != null))
         {
             return(base.GetDefaultValue(preferred_type));
         }
         return(DatePrototype.toLocaleString(this));
     }
     if (!base.noExpando)
     {
         object obj4 = base.NameTable["valueOf"];
         if ((obj4 == null) && (preferred_type == PreferredType.Either))
         {
             obj4 = base.NameTable["toString"];
         }
         if (obj4 != null)
         {
             return(base.GetDefaultValue(preferred_type));
         }
     }
     return(this.value);
 }
        public static double UTC(object year, object month, object date, object hours, object minutes, object seconds, object ms)
        {
            if (year is Missing)
            {
                return((((double)DateTime.Now.ToUniversalTime().Ticks) / 10000.0) - 62135596800000);
            }
            double val  = Microsoft.JScript.Convert.ToNumber(year);
            double num2 = (month is Missing) ? 0.0 : Microsoft.JScript.Convert.ToNumber(month);
            double num3 = (date is Missing) ? 1.0 : Microsoft.JScript.Convert.ToNumber(date);
            double hour = (hours is Missing) ? 0.0 : Microsoft.JScript.Convert.ToNumber(hours);
            double min  = (minutes is Missing) ? 0.0 : Microsoft.JScript.Convert.ToNumber(minutes);
            double sec  = (seconds is Missing) ? 0.0 : Microsoft.JScript.Convert.ToNumber(seconds);
            double num7 = (ms is Missing) ? 0.0 : Microsoft.JScript.Convert.ToNumber(ms);
            int    num8 = (int)Runtime.DoubleToInt64(val);

            if ((!double.IsNaN(val) && (0 <= num8)) && (num8 <= 0x63))
            {
                val = num8 + 0x76c;
            }
            double day  = DatePrototype.MakeDay(val, num2, num3);
            double time = DatePrototype.MakeTime(hour, min, sec, num7);

            return(DatePrototype.TimeClip(DatePrototype.MakeDate(day, time)));
        }
Ejemplo n.º 10
0
 public string DoubleToDateString(double value)
 {
     return(DatePrototype.DateToString(value));
 }
Ejemplo n.º 11
0
 internal DateConstructor()
   : base(FunctionPrototype.ob, "Date", 7) {
   this.originalPrototype = DatePrototype.ob;
   DatePrototype._constructor = this;
   this.proto = DatePrototype.ob;
 }
Ejemplo n.º 12
0
 public static double parse(String str)
 {
     return(DatePrototype.ParseDate(str));
 }
Ejemplo n.º 13
0
 public String Invoke()
 {
     return(DatePrototype.DateToString(DateTime.Now.ToUniversalTime().Ticks / DatePrototype.ticksPerMillisecond - DatePrototype.msTo1970));
 }
Ejemplo n.º 14
0
 public String Invoke()
 {
     return(DatePrototype.toString(CreateInstance()));
 }
        internal static object QuickCall(object[] args, object thisob, JSBuiltin biFunc, MethodInfo method, VsaEngine engine)
        {
            int length = args.Length;

            switch (biFunc)
            {
            case JSBuiltin.Array_concat:
                return(ArrayPrototype.concat(thisob, engine, args));

            case JSBuiltin.Array_join:
                return(ArrayPrototype.join(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Array_pop:
                return(ArrayPrototype.pop(thisob));

            case JSBuiltin.Array_push:
                return(ArrayPrototype.push(thisob, args));

            case JSBuiltin.Array_reverse:
                return(ArrayPrototype.reverse(thisob));

            case JSBuiltin.Array_shift:
                return(ArrayPrototype.shift(thisob));

            case JSBuiltin.Array_slice:
                return(ArrayPrototype.slice(thisob, engine, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.Array_sort:
                return(ArrayPrototype.sort(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Array_splice:
                return(ArrayPrototype.splice(thisob, engine, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), Microsoft.JScript.Convert.ToNumber(GetArg(args, 1, length)), VarArgs(args, 2, length)));

            case JSBuiltin.Array_toLocaleString:
                return(ArrayPrototype.toLocaleString(thisob));

            case JSBuiltin.Array_toString:
                return(ArrayPrototype.toString(thisob));

            case JSBuiltin.Array_unshift:
                return(ArrayPrototype.unshift(thisob, args));

            case JSBuiltin.Boolean_toString:
                return(BooleanPrototype.toString(thisob));

            case JSBuiltin.Boolean_valueOf:
                return(BooleanPrototype.valueOf(thisob));

            case JSBuiltin.Date_getDate:
                return(DatePrototype.getDate(thisob));

            case JSBuiltin.Date_getDay:
                return(DatePrototype.getDay(thisob));

            case JSBuiltin.Date_getFullYear:
                return(DatePrototype.getFullYear(thisob));

            case JSBuiltin.Date_getHours:
                return(DatePrototype.getHours(thisob));

            case JSBuiltin.Date_getMilliseconds:
                return(DatePrototype.getMilliseconds(thisob));

            case JSBuiltin.Date_getMinutes:
                return(DatePrototype.getMinutes(thisob));

            case JSBuiltin.Date_getMonth:
                return(DatePrototype.getMonth(thisob));

            case JSBuiltin.Date_getSeconds:
                return(DatePrototype.getSeconds(thisob));

            case JSBuiltin.Date_getTime:
                return(DatePrototype.getTime(thisob));

            case JSBuiltin.Date_getTimezoneOffset:
                return(DatePrototype.getTimezoneOffset(thisob));

            case JSBuiltin.Date_getUTCDate:
                return(DatePrototype.getUTCDate(thisob));

            case JSBuiltin.Date_getUTCDay:
                return(DatePrototype.getUTCDay(thisob));

            case JSBuiltin.Date_getUTCFullYear:
                return(DatePrototype.getUTCFullYear(thisob));

            case JSBuiltin.Date_getUTCHours:
                return(DatePrototype.getUTCHours(thisob));

            case JSBuiltin.Date_getUTCMilliseconds:
                return(DatePrototype.getUTCMilliseconds(thisob));

            case JSBuiltin.Date_getUTCMinutes:
                return(DatePrototype.getUTCMinutes(thisob));

            case JSBuiltin.Date_getUTCMonth:
                return(DatePrototype.getUTCMonth(thisob));

            case JSBuiltin.Date_getUTCSeconds:
                return(DatePrototype.getUTCSeconds(thisob));

            case JSBuiltin.Date_getVarDate:
                return(DatePrototype.getVarDate(thisob));

            case JSBuiltin.Date_getYear:
                return(DatePrototype.getYear(thisob));

            case JSBuiltin.Date_parse:
                return(DateConstructor.parse(Microsoft.JScript.Convert.ToString(GetArg(args, 0, length))));

            case JSBuiltin.Date_setDate:
                return(DatePrototype.setDate(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Date_setFullYear:
                return(DatePrototype.setFullYear(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length), GetArg(args, 2, length)));

            case JSBuiltin.Date_setHours:
                return(DatePrototype.setHours(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length), GetArg(args, 2, length), GetArg(args, 3, length)));

            case JSBuiltin.Date_setMinutes:
                return(DatePrototype.setMinutes(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length), GetArg(args, 2, length)));

            case JSBuiltin.Date_setMilliseconds:
                return(DatePrototype.setMilliseconds(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Date_setMonth:
                return(DatePrototype.setMonth(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.Date_setSeconds:
                return(DatePrototype.setSeconds(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.Date_setTime:
                return(DatePrototype.setTime(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Date_setUTCDate:
                return(DatePrototype.setUTCDate(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Date_setUTCFullYear:
                return(DatePrototype.setUTCFullYear(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length), GetArg(args, 2, length)));

            case JSBuiltin.Date_setUTCHours:
                return(DatePrototype.setUTCHours(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length), GetArg(args, 2, length), GetArg(args, 3, length)));

            case JSBuiltin.Date_setUTCMinutes:
                return(DatePrototype.setUTCMinutes(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length), GetArg(args, 2, length)));

            case JSBuiltin.Date_setUTCMilliseconds:
                return(DatePrototype.setUTCMilliseconds(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Date_setUTCMonth:
                return(DatePrototype.setUTCMonth(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.Date_setUTCSeconds:
                return(DatePrototype.setUTCSeconds(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.Date_setYear:
                return(DatePrototype.setYear(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Date_toDateString:
                return(DatePrototype.toDateString(thisob));

            case JSBuiltin.Date_toGMTString:
                return(DatePrototype.toGMTString(thisob));

            case JSBuiltin.Date_toLocaleDateString:
                return(DatePrototype.toLocaleDateString(thisob));

            case JSBuiltin.Date_toLocaleString:
                return(DatePrototype.toLocaleString(thisob));

            case JSBuiltin.Date_toLocaleTimeString:
                return(DatePrototype.toLocaleTimeString(thisob));

            case JSBuiltin.Date_toString:
                return(DatePrototype.toString(thisob));

            case JSBuiltin.Date_toTimeString:
                return(DatePrototype.toTimeString(thisob));

            case JSBuiltin.Date_toUTCString:
                return(DatePrototype.toUTCString(thisob));

            case JSBuiltin.Date_UTC:
                return(DateConstructor.UTC(GetArg(args, 0, length), GetArg(args, 1, length), GetArg(args, 2, length), GetArg(args, 3, length), GetArg(args, 4, length), GetArg(args, 5, length), GetArg(args, 6, length)));

            case JSBuiltin.Date_valueOf:
                return(DatePrototype.valueOf(thisob));

            case JSBuiltin.Enumerator_atEnd:
                return(EnumeratorPrototype.atEnd(thisob));

            case JSBuiltin.Enumerator_item:
                return(EnumeratorPrototype.item(thisob));

            case JSBuiltin.Enumerator_moveFirst:
                EnumeratorPrototype.moveFirst(thisob);
                return(null);

            case JSBuiltin.Enumerator_moveNext:
                EnumeratorPrototype.moveNext(thisob);
                return(null);

            case JSBuiltin.Error_toString:
                return(ErrorPrototype.toString(thisob));

            case JSBuiltin.Function_apply:
                return(FunctionPrototype.apply(thisob, GetArg(args, 0, length), GetArg(args, 1, length)));

            case JSBuiltin.Function_call:
                return(FunctionPrototype.call(thisob, GetArg(args, 0, length), VarArgs(args, 1, length)));

            case JSBuiltin.Function_toString:
                return(FunctionPrototype.toString(thisob));

            case JSBuiltin.Global_CollectGarbage:
                GlobalObject.CollectGarbage();
                return(null);

            case JSBuiltin.Global_decodeURI:
                return(GlobalObject.decodeURI(GetArg(args, 0, length)));

            case JSBuiltin.Global_decodeURIComponent:
                return(GlobalObject.decodeURIComponent(GetArg(args, 0, length)));

            case JSBuiltin.Global_encodeURI:
                return(GlobalObject.encodeURI(GetArg(args, 0, length)));

            case JSBuiltin.Global_encodeURIComponent:
                return(GlobalObject.encodeURIComponent(GetArg(args, 0, length)));

            case JSBuiltin.Global_escape:
                return(GlobalObject.escape(GetArg(args, 0, length)));

            case JSBuiltin.Global_eval:
                return(GlobalObject.eval(GetArg(args, 0, length)));

            case JSBuiltin.Global_GetObject:
                return(GlobalObject.GetObject(GetArg(args, 0, length), GetArg(args, 1, length)));

            case JSBuiltin.Global_isNaN:
                return(GlobalObject.isNaN(GetArg(args, 0, length)));

            case JSBuiltin.Global_isFinite:
                return(GlobalObject.isFinite(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Global_parseFloat:
                return(GlobalObject.parseFloat(GetArg(args, 0, length)));

            case JSBuiltin.Global_parseInt:
                return(GlobalObject.parseInt(GetArg(args, 0, length), GetArg(args, 1, length)));

            case JSBuiltin.Global_ScriptEngine:
                return(GlobalObject.ScriptEngine());

            case JSBuiltin.Global_ScriptEngineBuildVersion:
                return(GlobalObject.ScriptEngineBuildVersion());

            case JSBuiltin.Global_ScriptEngineMajorVersion:
                return(GlobalObject.ScriptEngineMajorVersion());

            case JSBuiltin.Global_ScriptEngineMinorVersion:
                return(GlobalObject.ScriptEngineMinorVersion());

            case JSBuiltin.Global_unescape:
                return(GlobalObject.unescape(GetArg(args, 0, length)));

            case JSBuiltin.Math_abs:
                return(MathObject.abs(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_acos:
                return(MathObject.acos(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_asin:
                return(MathObject.asin(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_atan:
                return(MathObject.atan(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_atan2:
                return(MathObject.atan2(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), Microsoft.JScript.Convert.ToNumber(GetArg(args, 1, length))));

            case JSBuiltin.Math_ceil:
                return(MathObject.ceil(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_cos:
                return(MathObject.cos(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_exp:
                return(MathObject.exp(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_floor:
                return(MathObject.floor(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_log:
                return(MathObject.log(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_max:
                return(MathObject.max(GetArg(args, 0, length), GetArg(args, 1, length), VarArgs(args, 2, length)));

            case JSBuiltin.Math_min:
                return(MathObject.min(GetArg(args, 0, length), GetArg(args, 1, length), VarArgs(args, 2, length)));

            case JSBuiltin.Math_pow:
                return(MathObject.pow(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), Microsoft.JScript.Convert.ToNumber(GetArg(args, 1, length))));

            case JSBuiltin.Math_random:
                return(MathObject.random());

            case JSBuiltin.Math_round:
                return(MathObject.round(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_sin:
                return(MathObject.sin(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_sqrt:
                return(MathObject.sqrt(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Math_tan:
                return(MathObject.tan(Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Number_toExponential:
                return(NumberPrototype.toExponential(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Number_toFixed:
                return(NumberPrototype.toFixed(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.Number_toLocaleString:
                return(NumberPrototype.toLocaleString(thisob));

            case JSBuiltin.Number_toPrecision:
                return(NumberPrototype.toPrecision(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Number_toString:
                return(NumberPrototype.toString(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Number_valueOf:
                return(NumberPrototype.valueOf(thisob));

            case JSBuiltin.Object_hasOwnProperty:
                return(ObjectPrototype.hasOwnProperty(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Object_isPrototypeOf:
                return(ObjectPrototype.isPrototypeOf(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Object_propertyIsEnumerable:
                return(ObjectPrototype.propertyIsEnumerable(thisob, GetArg(args, 0, length)));

            case JSBuiltin.Object_toLocaleString:
                return(ObjectPrototype.toLocaleString(thisob));

            case JSBuiltin.Object_toString:
                return(ObjectPrototype.toString(thisob));

            case JSBuiltin.Object_valueOf:
                return(ObjectPrototype.valueOf(thisob));

            case JSBuiltin.RegExp_compile:
                return(RegExpPrototype.compile(thisob, GetArg(args, 0, length), GetArg(args, 1, length)));

            case JSBuiltin.RegExp_exec:
                return(RegExpPrototype.exec(thisob, GetArg(args, 0, length)));

            case JSBuiltin.RegExp_test:
                return(RegExpPrototype.test(thisob, GetArg(args, 0, length)));

            case JSBuiltin.RegExp_toString:
                return(RegExpPrototype.toString(thisob));

            case JSBuiltin.String_anchor:
                return(StringPrototype.anchor(thisob, GetArg(args, 0, length)));

            case JSBuiltin.String_big:
                return(StringPrototype.big(thisob));

            case JSBuiltin.String_blink:
                return(StringPrototype.blink(thisob));

            case JSBuiltin.String_bold:
                return(StringPrototype.bold(thisob));

            case JSBuiltin.String_charAt:
                return(StringPrototype.charAt(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.String_charCodeAt:
                return(StringPrototype.charCodeAt(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length))));

            case JSBuiltin.String_concat:
                return(StringPrototype.concat(thisob, args));

            case JSBuiltin.String_fixed:
                return(StringPrototype.@fixed(thisob));

            case JSBuiltin.String_fontcolor:
                return(StringPrototype.fontcolor(thisob, GetArg(args, 0, length)));

            case JSBuiltin.String_fontsize:
                return(StringPrototype.fontsize(thisob, GetArg(args, 0, length)));

            case JSBuiltin.String_fromCharCode:
                return(StringConstructor.fromCharCode(args));

            case JSBuiltin.String_indexOf:
                return(StringPrototype.indexOf(thisob, GetArg(args, 0, length), Microsoft.JScript.Convert.ToNumber(GetArg(args, 1, length))));

            case JSBuiltin.String_italics:
                return(StringPrototype.italics(thisob));

            case JSBuiltin.String_lastIndexOf:
                return(StringPrototype.lastIndexOf(thisob, GetArg(args, 0, length), Microsoft.JScript.Convert.ToNumber(GetArg(args, 1, length))));

            case JSBuiltin.String_link:
                return(StringPrototype.link(thisob, GetArg(args, 0, length)));

            case JSBuiltin.String_localeCompare:
                return(StringPrototype.localeCompare(thisob, GetArg(args, 0, length)));

            case JSBuiltin.String_match:
                return(StringPrototype.match(thisob, engine, GetArg(args, 0, length)));

            case JSBuiltin.String_replace:
                return(StringPrototype.replace(thisob, GetArg(args, 0, length), GetArg(args, 1, length)));

            case JSBuiltin.String_search:
                return(StringPrototype.search(thisob, engine, GetArg(args, 0, length)));

            case JSBuiltin.String_slice:
                return(StringPrototype.slice(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.String_small:
                return(StringPrototype.small(thisob));

            case JSBuiltin.String_split:
                return(StringPrototype.split(thisob, engine, GetArg(args, 0, length), GetArg(args, 1, length)));

            case JSBuiltin.String_strike:
                return(StringPrototype.strike(thisob));

            case JSBuiltin.String_sub:
                return(StringPrototype.sub(thisob));

            case JSBuiltin.String_substr:
                return(StringPrototype.substr(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.String_substring:
                return(StringPrototype.substring(thisob, Microsoft.JScript.Convert.ToNumber(GetArg(args, 0, length)), GetArg(args, 1, length)));

            case JSBuiltin.String_sup:
                return(StringPrototype.sup(thisob));

            case JSBuiltin.String_toLocaleLowerCase:
                return(StringPrototype.toLocaleLowerCase(thisob));

            case JSBuiltin.String_toLocaleUpperCase:
                return(StringPrototype.toLocaleUpperCase(thisob));

            case JSBuiltin.String_toLowerCase:
                return(StringPrototype.toLowerCase(thisob));

            case JSBuiltin.String_toString:
                return(StringPrototype.toString(thisob));

            case JSBuiltin.String_toUpperCase:
                return(StringPrototype.toUpperCase(thisob));

            case JSBuiltin.String_valueOf:
                return(StringPrototype.valueOf(thisob));

            case JSBuiltin.VBArray_dimensions:
                return(VBArrayPrototype.dimensions(thisob));

            case JSBuiltin.VBArray_getItem:
                return(VBArrayPrototype.getItem(thisob, args));

            case JSBuiltin.VBArray_lbound:
                return(VBArrayPrototype.lbound(thisob, GetArg(args, 0, length)));

            case JSBuiltin.VBArray_toArray:
                return(VBArrayPrototype.toArray(thisob, engine));

            case JSBuiltin.VBArray_ubound:
                return(VBArrayPrototype.ubound(thisob, GetArg(args, 0, length)));
            }
            return(method.Invoke(thisob, BindingFlags.Default, JSBinder.ob, args, null));
        }
 public string Invoke()
 {
     return(DatePrototype.DateToString((((double)DateTime.Now.ToUniversalTime().Ticks) / 10000.0) - 62135596800000));
 }