public CatchBlock Update(ParameterExpression variable, Expression filter, Expression body) { if (variable == Variable && filter == Filter && body == Body) { return this; } return Expression.MakeCatchBlock(Test, variable, body, filter); } }
protected override CatchBlock VisitCatchBlock(CatchBlock node) { if (node.Variable != null) { _environment.Push(new[] { node.Variable }); } // // Just visit children to perform inlining of constants or defaults. Note that the parent // try expression requires that non-trivial bindings are satisfied by the protected region // so we don't have to worry about that over here. // var filter = Visit(node.Filter); var body = Visit(node.Body); if (node.Variable != null) { _environment.Pop(); } return(node.Update(node.Variable, filter, body)); }