Ejemplo n.º 1
0
        internal override IList <Executable> Resolve(ParserContext parser)
        {
            this.ValueStackDepth = parser.ValueStackDepth;

            this.TryBlock = Executable.Resolve(parser, this.TryBlock).ToArray();
            foreach (CatchBlock cb in this.CatchBlocks)
            {
                cb.Code = Executable.Resolve(parser, cb.Code).ToArray();
            }
            this.FinallyBlock = Executable.Resolve(parser, this.FinallyBlock).ToArray();

            return(this.TryBlock.Length == 0
                ? this.FinallyBlock // No try? The finally then just functions as normal unwrapped code.
                : Listify(this));
        }
Ejemplo n.º 2
0
        internal override void Resolve(ParserContext parser)
        {
            parser.ValueStackDepth = 0;

            this.FunctionID = parser.GetNextFunctionId();

            for (int i = 0; i < this.DefaultValues.Length; ++i)
            {
                if (this.DefaultValues[i] != null)
                {
                    this.DefaultValues[i] = this.DefaultValues[i].Resolve(parser);
                }
            }

            this.Code = Executable.Resolve(parser, this.Code).ToArray();
            this.Code = Executable.EnsureBlockReturns(this.Code, this);
        }