IronPython.Compiler.Ast.ScopeStatement.WrapScopeStatements C# (CSharp) Метод

WrapScopeStatements() приватный Метод

Wraps the body of a statement which should result in a frame being available during exception handling. This ensures the line number is updated as the stack is unwound.
private WrapScopeStatements ( System.Linq.Expressions body, bool canThrow ) : Expression
body System.Linq.Expressions
canThrow bool
Результат System.Linq.Expressions.Expression
        internal MSAst.Expression/*!*/ WrapScopeStatements(MSAst.Expression/*!*/ body, bool canThrow) {
            if (canThrow) {
                body = Ast.Block(
                    new[] { LineNumberExpression, LineNumberUpdated },
                    Ast.TryCatch(
                        body,
                        Ast.Catch(
                            _catchException,
                            Ast.Block(
                                GetUpdateTrackbackExpression(_catchException),
                                Ast.Rethrow(body.Type)
                            )
                        )
                    )
                );
            }
            
            return body;
        }