using System;
using System.Collections.Generic;
using System.Linq;
using Jint.Native.Object;
using Jint.Runtime;
using Jint.Runtime.Descriptors;
using Jint.Runtime.Interop;
namespace Jint.Native.Array
{
///
/// http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4
///
public sealed class ArrayPrototype : ArrayInstance
{
private ArrayPrototype(Engine engine) : base(engine)
{
}
public static ArrayPrototype CreatePrototypeObject(Engine engine, ArrayConstructor arrayConstructor)
{
var obj = new ArrayPrototype(engine)
{
Extensible = true,
Prototype = engine.Object.PrototypeObject
};
obj.FastAddProperty("length", 0, true, false, false);
obj.FastAddProperty("constructor", arrayConstructor, false, false, false);
return obj;
}
public void Configure()
{
FastAddProperty("toString", new ClrFunctionInstance