// 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"); }
// 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"); }
// 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); }