| 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 6a0f0896e077806775ba56fc15e010d536d322ab..e4e9f48e0cc86b17888070951a485d1e0cceb751 100644
|
| --- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
|
| +++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
|
| @@ -785,34 +785,37 @@ class AstBuilder extends ScopeListener {
|
| void handleCatchBlock(Token onKeyword, Token catchKeyword) {
|
| debugEvent("CatchBlock");
|
| Block body = pop();
|
| - FormalParameterList catchParameters = popIfNotNull(catchKeyword);
|
| - if (catchKeyword != null) {
|
| - exitLocalScope();
|
| - }
|
| + 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);
|
|
|