Jurassic.Compiler.DynamicILGenerator.EndExceptionBlock C# (CSharp) Method

EndExceptionBlock() public method

Ends a try-catch-finally block.
public EndExceptionBlock ( ) : void
return void
        public override void EndExceptionBlock()
        {
            if (this.activeExceptionRegions == null || this.activeExceptionRegions.Count == 0)
                throw new InvalidOperationException("BeginExceptionBlock() must have been called before calling this method.");

            // Remove the top-most exception region from the stack.
            var exceptionRegion = this.activeExceptionRegions.Pop();
            if (exceptionRegion.Clauses.Count == 0)
                throw new InvalidOperationException("At least one catch, finally, fault or filter block is required.");

            // Close off the current exception clause.
            EndCurrentClause(exceptionRegion);

            // Define a label for the end of the exception region.
            this.DefineLabelPosition(exceptionRegion.EndLabel);

            // Add the exception region to a list for later processing.
            if (this.exceptionRegions == null)
                this.exceptionRegions = new List<ExceptionRegion>();
            this.exceptionRegions.Add(exceptionRegion);
        }
DynamicILGenerator