示例#1
0
        public override int Compile(FunctionContext context)
        {
            var stack = 0;

            stack += Left.Compile(context);

            if (Start != null)
            {
                stack += Start.Compile(context);
            }
            else
            {
                stack += context.LoadUndefined();
            }

            if (End != null)
            {
                stack += End.Compile(context);
            }
            else
            {
                stack += context.LoadUndefined();
            }

            if (Step != null)
            {
                stack += Step.Compile(context);
            }
            else
            {
                stack += context.LoadUndefined();
            }

            context.Position(Token); // debug info
            stack += context.Slice();

            CheckStack(stack, 1);
            return(stack);
        }