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

EndCurrentClause() private method

Closes the currently open exception clause.
private EndCurrentClause ( ExceptionRegion exceptionRegion ) : void
exceptionRegion ExceptionRegion The exception region to modify.
return void
        private void EndCurrentClause(ExceptionRegion exceptionRegion)
        {
            if (exceptionRegion.Clauses.Count == 0)
            {
                // End the try block.
                Leave(exceptionRegion.EndLabel);
                exceptionRegion.TryLength = this.offset - exceptionRegion.Start;
            }
            else
            {
                var latestClause = exceptionRegion.Clauses[exceptionRegion.Clauses.Count - 1];
                switch (latestClause.Type)
                {
                    case ExceptionClauseType.Catch:
                        Leave(exceptionRegion.EndLabel);
                        break;
                    case ExceptionClauseType.Finally:
                        EndFinally();
                        break;
                    case ExceptionClauseType.Filter:
                        break;
                    case ExceptionClauseType.Fault:
                        EndFault();
                        break;
                }
                latestClause.ILLength = this.offset - latestClause.ILStart;
            }
        }
DynamicILGenerator