AjScript.Primitives.ArrayFunction.ArrayFunction C# (CSharp) 메소드

ArrayFunction() 공개 메소드

public ArrayFunction ( IContext context ) : System
context IContext
리턴 System
        public ArrayFunction(IContext context)
            : base(null, null, context)
        {
            var prototype = new DynamicObject();

            if (context != null)
            {
                var obj = context.GetValue("Object");

                if (obj != null && obj is DynamicObject)
                {
                    var superproto = ((DynamicObject)obj).GetValue("prototype");
                    if (superproto != null && superproto is DynamicObject)
                        prototype.SetValue("prototype", superproto);
                }
            }

            this.SetValue("isArray", isArrayFunction);
            this.SetValue("prototype", prototype);
            prototype.SetValue("push", pushFunction);
            prototype.SetValue("pop", popFunction);
            prototype.SetValue("unshift", unshiftFunction);
            prototype.SetValue("shift", shiftFunction);
            prototype.SetValue("join", joinFunction);
            prototype.SetValue("slice", sliceFunction);
        }