상속: ScriptFunction
 internal FunctionConstructor(LenientFunctionPrototype prototypeProp) : base(prototypeProp, "Function", 1)
 {
     this.originalPrototype = prototypeProp;
     prototypeProp.constructor = this;
     base.proto = prototypeProp;
     base.noExpando = false;
 }
 internal FunctionConstructor(LenientFunctionPrototype prototypeProp) : base(prototypeProp, "Function", 1)
 {
     this.originalPrototype    = prototypeProp;
     prototypeProp.constructor = this;
     base.proto     = prototypeProp;
     base.noExpando = false;
 }
	// Constructor.
	internal NumberConstructor(FunctionPrototype parent)
		: base(parent, "Number", 1)
	{
		Put("MAX_VALUE", Double.MaxValue,
			PropertyAttributes.DontEnum|
			PropertyAttributes.DontDelete|
			PropertyAttributes.ReadOnly);
		
		Put("MIN_VALUE", Double.MinValue,
			PropertyAttributes.DontEnum|
			PropertyAttributes.DontDelete|
			PropertyAttributes.ReadOnly);
		
		Put("NaN", Double.NaN,
			PropertyAttributes.DontEnum|
			PropertyAttributes.DontDelete|
			PropertyAttributes.ReadOnly);
		
		Put("NEGATIVE_INFINITY", Double.NegativeInfinity,
			PropertyAttributes.DontEnum|
			PropertyAttributes.DontDelete|
			PropertyAttributes.ReadOnly);
		
		Put("POSITIVE_INFINITY", Double.PositiveInfinity,
			PropertyAttributes.DontEnum|
			PropertyAttributes.DontDelete|
			PropertyAttributes.ReadOnly);
			
		MAX_VALUE = Get("MAX_VALUE");
		MIN_VALUE = Get("MIN_VALUE");
		NaN = Get("NaN");
		NEGATIVE_INFINITY = Get("NEGATIVE_INFINITY");
		POSITIVE_INFINITY = Get("POSITIVE_INFINITY");
	}
	// Constructor.
	internal FunctionObject(FunctionPrototype parent, JFunction defn,
							ScriptObject declaringScope)
			: base(parent, defn.name, Support.ExprListLength(defn.fparams))
			{
				this.defn = defn;
				this.declaringScope = declaringScope;
			}
예제 #5
0
        internal LenientMathObject(ScriptObject parent, FunctionPrototype funcprot)
            : base(parent)
        {
            this.noExpando = false;
            Type super = typeof(MathObject);

            this.abs    = new BuiltinFunction("abs", this, super.GetMethod("abs"), funcprot);
            this.acos   = new BuiltinFunction("acos", this, super.GetMethod("acos"), funcprot);
            this.asin   = new BuiltinFunction("asin", this, super.GetMethod("asin"), funcprot);
            this.atan   = new BuiltinFunction("atan", this, super.GetMethod("atan"), funcprot);
            this.atan2  = new BuiltinFunction("atan2", this, super.GetMethod("atan2"), funcprot);
            this.ceil   = new BuiltinFunction("ceil", this, super.GetMethod("ceil"), funcprot);
            this.cos    = new BuiltinFunction("cos", this, super.GetMethod("cos"), funcprot);
            this.exp    = new BuiltinFunction("exp", this, super.GetMethod("exp"), funcprot);
            this.floor  = new BuiltinFunction("floor", this, super.GetMethod("floor"), funcprot);
            this.log    = new BuiltinFunction("log", this, super.GetMethod("log"), funcprot);
            this.max    = new BuiltinFunction("max", this, super.GetMethod("max"), funcprot);
            this.min    = new BuiltinFunction("min", this, super.GetMethod("min"), funcprot);
            this.pow    = new BuiltinFunction("pow", this, super.GetMethod("pow"), funcprot);
            this.random = new BuiltinFunction("random", this, super.GetMethod("random"), funcprot);
            this.round  = new BuiltinFunction("round", this, super.GetMethod("round"), funcprot);
            this.sin    = new BuiltinFunction("sin", this, super.GetMethod("sin"), funcprot);
            this.sqrt   = new BuiltinFunction("sqrt", this, super.GetMethod("sqrt"), funcprot);
            this.tan    = new BuiltinFunction("tan", this, super.GetMethod("tan"), funcprot);
        }
예제 #6
0
        // Constructor.
        internal NumberConstructor(FunctionPrototype parent)
            : base(parent, "Number", 1)
        {
            Put("MAX_VALUE", Double.MaxValue,
                PropertyAttributes.DontEnum |
                PropertyAttributes.DontDelete |
                PropertyAttributes.ReadOnly);

            Put("MIN_VALUE", Double.MinValue,
                PropertyAttributes.DontEnum |
                PropertyAttributes.DontDelete |
                PropertyAttributes.ReadOnly);

            Put("NaN", Double.NaN,
                PropertyAttributes.DontEnum |
                PropertyAttributes.DontDelete |
                PropertyAttributes.ReadOnly);

            Put("NEGATIVE_INFINITY", Double.NegativeInfinity,
                PropertyAttributes.DontEnum |
                PropertyAttributes.DontDelete |
                PropertyAttributes.ReadOnly);

            Put("POSITIVE_INFINITY", Double.PositiveInfinity,
                PropertyAttributes.DontEnum |
                PropertyAttributes.DontDelete |
                PropertyAttributes.ReadOnly);

            MAX_VALUE         = Get("MAX_VALUE");
            MIN_VALUE         = Get("MIN_VALUE");
            NaN               = Get("NaN");
            NEGATIVE_INFINITY = Get("NEGATIVE_INFINITY");
            POSITIVE_INFINITY = Get("POSITIVE_INFINITY");
        }
예제 #7
0
 // Constructor.
 internal FunctionObject(FunctionPrototype parent, JFunction defn,
                         ScriptObject declaringScope)
     : base(parent, defn.name, Support.ExprListLength(defn.fparams))
 {
     this.defn           = defn;
     this.declaringScope = declaringScope;
 }
예제 #8
0
 internal StringConstructor(FunctionPrototype parent, LenientStringPrototype prototypeProp) : base(parent, "String", 1)
 {
     this.originalPrototype    = prototypeProp;
     prototypeProp.constructor = this;
     base.proto     = prototypeProp;
     base.noExpando = false;
 }
 internal FunctionConstructor()
     : base(FunctionPrototype.ob, "Function", 1)
 {
     this.originalPrototype         = FunctionPrototype.ob;
     FunctionPrototype._constructor = this;
     this.proto = FunctionPrototype.ob;
 }
 internal StringConstructor(FunctionPrototype parent, LenientStringPrototype prototypeProp)
   : base(parent, "String", 1) {
   this.originalPrototype = prototypeProp;
   prototypeProp.constructor = this;
   this.proto = prototypeProp;
   this.noExpando = false;
 }
	// Initialize the engine instance after construction.  Needed
	// to resolve circularity issues at startup time.
	public void Init()
			{
				// Initialize the basic "Object" and "Function" objects,
				// which must be created carefully to avoid circularities.
				objectPrototype = new LenientObjectPrototype();
				functionPrototype = new LenientFunctionPrototype();
				objectConstructor = new ObjectConstructor();
				functionConstructor = new FunctionConstructor();
				objectPrototype.Init(engine);
				functionPrototype.Init(engine, objectPrototype);
				objectConstructor.Init(engine, functionPrototype);
				functionConstructor.Init(engine, functionPrototype);
			}
예제 #12
0
 // Initialize the engine instance after construction.  Needed
 // to resolve circularity issues at startup time.
 public void Init()
 {
     // Initialize the basic "Object" and "Function" objects,
     // which must be created carefully to avoid circularities.
     objectPrototype     = new LenientObjectPrototype();
     functionPrototype   = new LenientFunctionPrototype();
     objectConstructor   = new ObjectConstructor();
     functionConstructor = new FunctionConstructor();
     objectPrototype.Init(engine);
     functionPrototype.Init(engine, objectPrototype);
     objectConstructor.Init(engine, functionPrototype);
     functionConstructor.Init(engine, functionPrototype);
 }
 internal LenientArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent)
 {
     base.noExpando = false;
     Type type = typeof(ArrayPrototype);
     this.concat = new BuiltinFunction("concat", this, type.GetMethod("concat"), funcprot);
     this.join = new BuiltinFunction("join", this, type.GetMethod("join"), funcprot);
     this.pop = new BuiltinFunction("pop", this, type.GetMethod("pop"), funcprot);
     this.push = new BuiltinFunction("push", this, type.GetMethod("push"), funcprot);
     this.reverse = new BuiltinFunction("reverse", this, type.GetMethod("reverse"), funcprot);
     this.shift = new BuiltinFunction("shift", this, type.GetMethod("shift"), funcprot);
     this.slice = new BuiltinFunction("slice", this, type.GetMethod("slice"), funcprot);
     this.sort = new BuiltinFunction("sort", this, type.GetMethod("sort"), funcprot);
     this.splice = new BuiltinFunction("splice", this, type.GetMethod("splice"), funcprot);
     this.unshift = new BuiltinFunction("unshift", this, type.GetMethod("unshift"), funcprot);
     this.toLocaleString = new BuiltinFunction("toLocaleString", this, type.GetMethod("toLocaleString"), funcprot);
     this.toString = new BuiltinFunction("toString", this, type.GetMethod("toString"), funcprot);
 }
예제 #14
0
        internal LenientArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent)
        {
            base.noExpando = false;
            Type type = typeof(ArrayPrototype);

            this.concat         = new BuiltinFunction("concat", this, type.GetMethod("concat"), funcprot);
            this.join           = new BuiltinFunction("join", this, type.GetMethod("join"), funcprot);
            this.pop            = new BuiltinFunction("pop", this, type.GetMethod("pop"), funcprot);
            this.push           = new BuiltinFunction("push", this, type.GetMethod("push"), funcprot);
            this.reverse        = new BuiltinFunction("reverse", this, type.GetMethod("reverse"), funcprot);
            this.shift          = new BuiltinFunction("shift", this, type.GetMethod("shift"), funcprot);
            this.slice          = new BuiltinFunction("slice", this, type.GetMethod("slice"), funcprot);
            this.sort           = new BuiltinFunction("sort", this, type.GetMethod("sort"), funcprot);
            this.splice         = new BuiltinFunction("splice", this, type.GetMethod("splice"), funcprot);
            this.unshift        = new BuiltinFunction("unshift", this, type.GetMethod("unshift"), funcprot);
            this.toLocaleString = new BuiltinFunction("toLocaleString", this, type.GetMethod("toLocaleString"), funcprot);
            this.toString       = new BuiltinFunction("toString", this, type.GetMethod("toString"), funcprot);
        }
 internal LenientArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
   : base(parent) {
   this.noExpando = false;
   Type super = typeof(ArrayPrototype);
   //this.constructor is given a value by the proper constructor class
   this.concat = new BuiltinFunction("concat", this, super.GetMethod("concat"), funcprot);
   this.join = new BuiltinFunction("join", this, super.GetMethod("join"), funcprot);
   this.pop = new BuiltinFunction("pop", this, super.GetMethod("pop"), funcprot);
   this.push = new BuiltinFunction("push", this, super.GetMethod("push"), funcprot);
   this.reverse = new BuiltinFunction("reverse", this, super.GetMethod("reverse"), funcprot);
   this.shift = new BuiltinFunction("shift", this, super.GetMethod("shift"), funcprot);
   this.slice = new BuiltinFunction("slice", this, super.GetMethod("slice"), funcprot);
   this.sort = new BuiltinFunction("sort", this, super.GetMethod("sort"), funcprot);
   this.splice = new BuiltinFunction("splice", this, super.GetMethod("splice"), funcprot);
   this.unshift = new BuiltinFunction("unshift", this, super.GetMethod("unshift"), funcprot);
   this.toLocaleString = new BuiltinFunction("toLocaleString", this, super.GetMethod("toLocaleString"), funcprot);
   this.toString = new BuiltinFunction("toString", this, super.GetMethod("toString"), funcprot);
 }
예제 #16
0
        internal LenientArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
            : base(parent)
        {
            this.noExpando = false;
            Type super = typeof(ArrayPrototype);

            //this.constructor is given a value by the proper constructor class
            this.concat         = new BuiltinFunction("concat", this, super.GetMethod("concat"), funcprot);
            this.join           = new BuiltinFunction("join", this, super.GetMethod("join"), funcprot);
            this.pop            = new BuiltinFunction("pop", this, super.GetMethod("pop"), funcprot);
            this.push           = new BuiltinFunction("push", this, super.GetMethod("push"), funcprot);
            this.reverse        = new BuiltinFunction("reverse", this, super.GetMethod("reverse"), funcprot);
            this.shift          = new BuiltinFunction("shift", this, super.GetMethod("shift"), funcprot);
            this.slice          = new BuiltinFunction("slice", this, super.GetMethod("slice"), funcprot);
            this.sort           = new BuiltinFunction("sort", this, super.GetMethod("sort"), funcprot);
            this.splice         = new BuiltinFunction("splice", this, super.GetMethod("splice"), funcprot);
            this.unshift        = new BuiltinFunction("unshift", this, super.GetMethod("unshift"), funcprot);
            this.toLocaleString = new BuiltinFunction("toLocaleString", this, super.GetMethod("toLocaleString"), funcprot);
            this.toString       = new BuiltinFunction("toString", this, super.GetMethod("toString"), funcprot);
        }
예제 #17
0
   internal LenientMathObject(ScriptObject parent, FunctionPrototype funcprot)
     : base(parent) {
     this.noExpando = false;
     Type super = typeof(MathObject);
 	  this.abs = new BuiltinFunction("abs", this, super.GetMethod("abs"), funcprot);
 	  this.acos = new BuiltinFunction("acos", this, super.GetMethod("acos"), funcprot);
 	  this.asin = new BuiltinFunction("asin", this, super.GetMethod("asin"), funcprot);
 	  this.atan = new BuiltinFunction("atan", this, super.GetMethod("atan"), funcprot);
 	  this.atan2 = new BuiltinFunction("atan2", this, super.GetMethod("atan2"), funcprot);
 	  this.ceil = new BuiltinFunction("ceil", this, super.GetMethod("ceil"), funcprot);
 	  this.cos = new BuiltinFunction("cos", this, super.GetMethod("cos"), funcprot);
 	  this.exp = new BuiltinFunction("exp", this, super.GetMethod("exp"), funcprot);
 	  this.floor = new BuiltinFunction("floor", this, super.GetMethod("floor"), funcprot);
 	  this.log = new BuiltinFunction("log", this, super.GetMethod("log"), funcprot);
 	  this.max = new BuiltinFunction("max", this, super.GetMethod("max"), funcprot);
 	  this.min = new BuiltinFunction("min", this, super.GetMethod("min"), funcprot);
 	  this.pow = new BuiltinFunction("pow", this, super.GetMethod("pow"), funcprot);
 	  this.random = new BuiltinFunction("random", this, super.GetMethod("random"), funcprot);
 	  this.round = new BuiltinFunction("round", this, super.GetMethod("round"), funcprot);
 	  this.sin = new BuiltinFunction("sin", this, super.GetMethod("sin"), funcprot);
 	  this.sqrt = new BuiltinFunction("sqrt", this, super.GetMethod("sqrt"), funcprot);
 	  this.tan = new BuiltinFunction("tan", this, super.GetMethod("tan"), funcprot);
   }
예제 #18
0
파일: MathObject.cs 프로젝트: ForNeVeR/pnet
        internal LenientMathObject(ScriptObject parent, FunctionPrototype prototype)
            : base(parent)
        {
            EngineInstance inst = EngineInstance.GetEngineInstance(engine);

            abs    = Get("abs");
            acos   = Get("acos");
            asin   = Get("asin");
            atan   = Get("atan");
            atan2  = Get("atan2");
            ceil   = Get("ceil");
            cos    = Get("cos");
            exp    = Get("exp");
            floor  = Get("floor");
            log    = Get("log");
            max    = Get("max");
            min    = Get("min");
            pow    = Get("pow");
            random = Get("random");
            round  = Get("round");
            sin    = Get("sin");
            sqrt   = Get("sqrt");
            tan    = Get("tan");
        }
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
   : base(parent) {
   //this.constructor is given a value by the constructor class
 }
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent)
 {
 }
	// Constructor.
	internal StringConstructor(FunctionPrototype parent)
			: base(parent, "String", 1) {}
예제 #22
0
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
     : base(parent)
 {
     //this.constructor is given a value by the constructor class
 }
예제 #23
0
 // Constructor.
 internal ArrayConstructor(FunctionPrototype parent)
     : base(parent, "Array", 1)
 {
 }
예제 #24
0
 // Constructor.
 internal StringConstructor(FunctionPrototype parent)
     : base(parent, "String", 1)
 {
 }
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent)
 {
 }
 internal StringPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent, "")
 {
     base.noExpando = true;
 }
 internal FunctionConstructor() : base(FunctionPrototype.ob, "Function", 1)
 {
     this.originalPrototype = FunctionPrototype.ob;
     FunctionPrototype._constructor = this;
     base.proto = FunctionPrototype.ob;
 }
	// Constructor.
	internal ArrayConstructor(FunctionPrototype parent)
			: base(parent, "Array", 1) {}
예제 #29
0
	internal LenientMathObject(ScriptObject parent, FunctionPrototype prototype)
		: base(parent)
	{
		EngineInstance inst = EngineInstance.GetEngineInstance(engine);
		
		abs = Get("abs");
		acos = Get("acos");
		asin = Get("asin");
		atan = Get("atan");
		atan2 = Get("atan2");
		ceil = Get("ceil");
		cos = Get("cos");
		exp = Get("exp");
		floor = Get("floor");
		log = Get("log");
		max = Get("max");
		min = Get("min");
		pow = Get("pow");
		random = Get("random");
		round = Get("round");
		sin = Get("sin");
		sqrt = Get("sqrt");
		tan = Get("tan");
	}
        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));
        }
예제 #31
0
 internal StringPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
     : base(parent, "")
 {
     this.noExpando = true;
 }