internal ObjectConstructor(LenientFunctionPrototype parent, LenientObjectPrototype prototypeProp) : base(parent, "Object", 1)
 {
     this.originalPrototype = prototypeProp;
     prototypeProp.constructor = this;
     base.proto = prototypeProp;
     base.noExpando = false;
 }
 internal ObjectConstructor(LenientFunctionPrototype parent, LenientObjectPrototype prototypeProp)
     : base(parent, "Object", 1)
 {
     this.originalPrototype    = prototypeProp;
     prototypeProp.constructor = this;
     this.proto     = prototypeProp;
     this.noExpando = false;
 }
Пример #3
0
 public static bool isPrototypeOf(Object thisob, Object ob){
   if (thisob is ScriptObject && ob is ScriptObject)
     while (ob != null) {
       if (ob == thisob)
         return true;
       ob = ((ScriptObject)ob).GetParent();
     }
   return false;
 }
Пример #4
0
 internal virtual object GetDefaultValue(Type hint, bool avoid_toString)
 {
     if (avoid_toString)
     {
         return(this);
     }
     else
     {
         return(ObjectPrototype.smartToString(this));
     }
 }
	// 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);
			}
Пример #6
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);
 }
Пример #7
0
 public static bool isPrototypeOf(object thisob, object ob)
 {
     if ((thisob is ScriptObject) && (ob is ScriptObject))
     {
         while (ob != null)
         {
             if (ob == thisob)
             {
                 return(true);
             }
             ob = ((ScriptObject)ob).GetParent();
         }
     }
     return(false);
 }
 public static bool isPrototypeOf(object thisob, object ob)
 {
     if ((thisob is ScriptObject) && (ob is ScriptObject))
     {
         while (ob != null)
         {
             if (ob == thisob)
             {
                 return true;
             }
             ob = ((ScriptObject) ob).GetParent();
         }
     }
     return false;
 }
Пример #9
0
 // Constructor.
 internal LenientArrayPrototype(ObjectPrototype parent, EngineInstance inst)
     : base(parent, inst)
 {
     constructor    = inst.GetArrayConstructor();
     concat         = Get("concat");
     join           = Get("join");
     pop            = Get("pop");
     push           = Get("push");
     reverse        = Get("reverse");
     shift          = Get("shift");
     slice          = Get("slice");
     sort           = Get("sort");
     splice         = Get("splice");
     toLocaleString = Get("toLocaleString");
     toString       = Get("toString");
     unshift        = Get("unshift");
 }
 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);
 }
Пример #12
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);
        }
Пример #13
0
 // Constructor.
 internal ArrayPrototype(ObjectPrototype parent, EngineInstance inst)
     : base(parent)
 {
     // Add the builtin "Array" properties to the prototype.
     Put("constructor", inst.GetArrayConstructor());
     AddBuiltin(inst, "concat");
     AddBuiltin(inst, "join");
     AddBuiltin(inst, "pop");
     AddBuiltin(inst, "push");
     AddBuiltin(inst, "reverse");
     AddBuiltin(inst, "shift");
     AddBuiltin(inst, "slice");
     AddBuiltin(inst, "sort");
     AddBuiltin(inst, "splice");
     AddBuiltin(inst, "toLocaleString");
     AddBuiltin(inst, "toString");
     AddBuiltin(inst, "unshift");
 }
	// Constructor.
	internal ArrayPrototype(ObjectPrototype parent, EngineInstance inst)
			: base(parent)
			{
				// Add the builtin "Array" properties to the prototype.
				Put("constructor", inst.GetArrayConstructor());
				AddBuiltin(inst, "concat");
				AddBuiltin(inst, "join");
				AddBuiltin(inst, "pop");
				AddBuiltin(inst, "push");
				AddBuiltin(inst, "reverse");
				AddBuiltin(inst, "shift");
				AddBuiltin(inst, "slice");
				AddBuiltin(inst, "sort");
				AddBuiltin(inst, "splice");
				AddBuiltin(inst, "toLocaleString");
				AddBuiltin(inst, "toString");
				AddBuiltin(inst, "unshift");
			}
Пример #15
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);
        }
Пример #16
0
 internal GlobalObject(){
   this.originalActiveXObjectField = null;
   this.originalArrayField = null;
   this.originalBooleanField = null;
   this.originalDateField = null;
   this.originalEnumeratorField = null;
   this.originalEvalErrorField = null;
   this.originalErrorField = null;
   this.originalFunctionField = null;
   this.originalNumberField = null;
   this.originalObjectField = null;
   this.originalObjectPrototypeField = null;
   this.originalRangeErrorField = null;
   this.originalReferenceErrorField = null;
   this.originalRegExpField = null;
   this.originalStringField = null;
   this.originalSyntaxErrorField = null;
   this.originalTypeErrorField = null;
   this.originalVBArrayField = null;
   this.originalURIErrorField = null;
 }
Пример #17
0
 internal GlobalObject()
 {
     this.originalActiveXObjectField   = null;
     this.originalArrayField           = null;
     this.originalBooleanField         = null;
     this.originalDateField            = null;
     this.originalEnumeratorField      = null;
     this.originalEvalErrorField       = null;
     this.originalErrorField           = null;
     this.originalFunctionField        = null;
     this.originalNumberField          = null;
     this.originalObjectField          = null;
     this.originalObjectPrototypeField = null;
     this.originalRangeErrorField      = null;
     this.originalReferenceErrorField  = null;
     this.originalRegExpField          = null;
     this.originalStringField          = null;
     this.originalSyntaxErrorField     = null;
     this.originalTypeErrorField       = null;
     this.originalVBArrayField         = null;
     this.originalURIErrorField        = null;
 }
Пример #18
0
 internal NumberPrototype(ObjectPrototype parent) : base(parent, 0.0)
 {
     base.noExpando = true;
 }
 internal ArrayPrototype(ObjectPrototype parent)
     : base(parent)
 {
     this.noExpando = true;
 }
Пример #20
0
 internal StringPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
     : base(parent, "")
 {
     this.noExpando = true;
 }
Пример #21
0
		protected BooleanPrototype (ObjectPrototype prototype, Type baseType)
		{
		}
 internal RegExpPrototype(ObjectPrototype parent)
     : base(parent)
 {
     //this.constructor is given a value by the proper constructor class
 }
	// Constructor.
	internal LenientArrayPrototype(ObjectPrototype parent, EngineInstance inst)
			: base(parent, inst)
			{
				constructor = inst.GetArrayConstructor();
				concat = Get("concat");
				join = Get("join");
				pop = Get("pop");
				push = Get("push");
				reverse = Get("reverse");
				shift = Get("shift");
				slice = Get("slice");
				sort = Get("sort");
				splice = Get("splice");
				toLocaleString = Get("toLocaleString");
				toString = Get("toString");
				unshift = Get("unshift");
			}
 internal EnumeratorPrototype(ObjectPrototype parent) : base(parent)
 {
 }
 internal EnumeratorPrototype(ObjectPrototype parent) : base(parent)
 {
 }
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent)
 {
 }
 internal EnumeratorPrototype(ObjectPrototype parent)
     : base(parent)
 {
     //this.constructor is given a value by the constructor class
 }
 internal RegExpPrototype(ObjectPrototype parent) : base(parent)
 {
 }
 protected BooleanPrototype(ObjectPrototype parent, Type baseType) : base(parent, baseType)
 {
     base.noExpando = true;
 }
Пример #30
0
        public static string ToString(object value, bool explicitOK)
        {
            IConvertible ic = value as IConvertible;
            TypeCode     tc = Convert.GetTypeCode(value, ic);

            switch (tc)
            {
            case TypeCode.Empty:
                return("undefined");

            case TypeCode.DBNull:
                return("null");

            case TypeCode.Boolean:
                bool r = (bool)value;
                if (r)
                {
                    return("true");
                }
                else
                {
                    return("false");
                }

            case TypeCode.Char:
                return(ic.ToInt16(null).ToString());

            case TypeCode.String:
                return(ic.ToString(null));

            case TypeCode.Object:
                if (value is StringObject)
                {
                    return(((StringObject)value).value);
                }
                else if (value is ScriptObject)
                {
                    ScriptObject obj_value = (ScriptObject)value;
                    if (obj_value.HasMethod("toString"))
                    {
                        return((string)obj_value.CallMethod("toString"));
                    }
                    else
                    {
                        return((string)ObjectPrototype.smartToString((JSObject)obj_value));
                    }
                }

                Console.WriteLine("value.GetType = {0}", value.GetType());
                throw new NotImplementedException();

            default:
                if (IsNumberTypeCode(tc))
                {
                    double val = ic.ToDouble(null);
                    return(ToString(val));
                }

                Console.WriteLine("tc = {0}", tc);
                throw new NotImplementedException();
            }
        }
 internal ObjectConstructor() : base(FunctionPrototype.ob, "Object", 1)
 {
     this.originalPrototype       = ObjectPrototype.ob;
     ObjectPrototype._constructor = this;
     base.proto = ObjectPrototype.ob;
 }
Пример #32
0
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
     : base(parent)
 {
     //this.constructor is given a value by the constructor class
 }
Пример #33
0
 internal NumberPrototype(ObjectPrototype parent)
     : base(parent, 0.0)
 {
     this.noExpando = true;
     //this.constructor is given a value by the proper constructor class
 }
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent)
   : base(parent) {
   //this.constructor is given a value by the constructor class
 }
        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));
        }
 internal DatePrototype(ObjectPrototype parent) : base(parent, 0.0)
 {
     base.noExpando = true;
 }
 internal ObjectConstructor() : base(FunctionPrototype.ob, "Object", 1)
 {
     this.originalPrototype = ObjectPrototype.ob;
     ObjectPrototype._constructor = this;
     base.proto = ObjectPrototype.ob;
 }
Пример #38
0
 internal NumberPrototype(ObjectPrototype parent)
   : base(parent, 0.0) {
   this.noExpando = true;
   //this.constructor is given a value by the proper constructor class
 }
 protected BooleanPrototype(ObjectPrototype parent, Type baseType) : base(parent, baseType)
 {
     base.noExpando = true;
 }
Пример #40
0
 protected BooleanPrototype(ObjectPrototype prototype, Type baseType)
 {
 }
 internal VBArrayPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent)
 {
 }
Пример #42
0
 internal EnumeratorPrototype(ObjectPrototype parent)
   : base(parent) {
   //this.constructor is given a value by the constructor class
 }
 internal StringPrototype(FunctionPrototype funcprot, ObjectPrototype parent) : base(parent, "")
 {
     base.noExpando = true;
 }
 internal ArrayPrototype(ObjectPrototype parent) : base(parent)
 {
     base.noExpando = true;
 }
 internal RegExpPrototype(ObjectPrototype parent)
   : base(parent) {
   //this.constructor is given a value by the proper constructor class
 }