コード例 #1
0
ファイル: ArrayPrototype.cs プロジェクト: ForNeVeR/pnet
 // 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");
 }
コード例 #2
0
ファイル: ArrayPrototype.cs プロジェクト: ForNeVeR/pnet
 // 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");
 }
コード例 #3
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");
			}
コード例 #4
0
ファイル: Convert.cs プロジェクト: ForNeVeR/pnet
        // Convert a value into a JScript object, throwing an exception
        // if the conversion is not possible.
        public static Object ToObject(Object value, VsaEngine engine)
        {
            EngineInstance instance = EngineInstance.GetEngineInstance(engine);

            if (value is String)
            {
                return(instance.GetStringConstructor().Construct(
                           engine,
                           new Object[] { value }));
            }
            else if (value is Array)
            {
                return(instance.GetArrayConstructor().Construct(
                           engine,
                           new Object[] { value }));
            }
            // TODO
            return(value);
        }
コード例 #5
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");
			}