Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| diff --git a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| index 34c6482dab79c5b3dc756bea50f3d4ebefcd8220..9f8eb5df819b1cd6ffdfc169d6c451af5b80b116 100644 |
| --- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| +++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| @@ -770,34 +770,37 @@ class AstBuilder extends ScopeListener { |
| void handleCatchBlock(Token onKeyword, Token catchKeyword) { |
| debugEvent("CatchBlock"); |
| Block body = pop(); |
| - FormalParameterList catchParameters = popIfNotNull(catchKeyword); |
| - if (catchKeyword != null) { |
| - exitLocalScope(); |
|
Paul Berry
2017/03/14 19:30:06
It's not obvious to me why it's safe to drop the c
scheglov
2017/03/14 19:34:42
No, this is an intentional change.
There is no cor
Paul Berry
2017/03/14 19:39:01
Ok, thanks for clarifying.
|
| - } |
| + FormalParameterList catchParameterList = popIfNotNull(catchKeyword); |
| TypeAnnotation type = popIfNotNull(onKeyword); |
| SimpleIdentifier exception; |
| SimpleIdentifier stackTrace; |
| - if (catchParameters != null) { |
| + if (catchParameterList != null) { |
| + List<FormalParameter> catchParameters = catchParameterList.parameters; |
| if (catchParameters.length > 0) { |
| - exception = catchParameters.parameters[0].identifier; |
| + exception = catchParameters[0].identifier; |
| } |
| if (catchParameters.length > 1) { |
| - stackTrace = catchParameters.parameters[1].identifier; |
| + stackTrace = catchParameters[1].identifier; |
| } |
| } |
| - BeginGroupToken leftParenthesis = catchKeyword.next; |
| push(ast.catchClause( |
| toAnalyzerToken(onKeyword), |
| type, |
| toAnalyzerToken(catchKeyword), |
| - toAnalyzerToken(leftParenthesis), |
| + catchParameterList?.leftParenthesis, |
| exception, |
| null, |
| stackTrace, |
| - toAnalyzerToken(leftParenthesis.endGroup), |
| + catchParameterList?.rightParenthesis, |
| body)); |
| } |
| + @override |
| + void handleFinallyBlock(Token finallyKeyword) { |
| + debugEvent("FinallyBlock"); |
| + // The finally block is popped in "endTryStatement". |
| + } |
| + |
| void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) { |
| Block finallyBlock = popIfNotNull(finallyKeyword); |
| List<CatchClause> catchClauses = popList(catchCount); |