| OLD | NEW | 
|---|
| 1 // Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file | 
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a | 
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. | 
| 4 | 4 | 
| 5 library fasta.body_builder; | 5 library fasta.body_builder; | 
| 6 | 6 | 
| 7 import '../fasta_codes.dart' | 7 import '../fasta_codes.dart' | 
| 8     show | 8     show | 
| 9         FastaMessage, | 9         FastaMessage, | 
| 10         codeConstFieldWithoutInitializer, | 10         codeConstFieldWithoutInitializer, | 
| (...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1933     if (catchKeyword != null) { | 1933     if (catchKeyword != null) { | 
| 1934       exitLocalScope(); | 1934       exitLocalScope(); | 
| 1935     } | 1935     } | 
| 1936     FormalParameters catchParameters = popIfNotNull(catchKeyword); | 1936     FormalParameters catchParameters = popIfNotNull(catchKeyword); | 
| 1937     DartType type = popIfNotNull(onKeyword) ?? const DynamicType(); | 1937     DartType type = popIfNotNull(onKeyword) ?? const DynamicType(); | 
| 1938     VariableDeclaration exception; | 1938     VariableDeclaration exception; | 
| 1939     VariableDeclaration stackTrace; | 1939     VariableDeclaration stackTrace; | 
| 1940     if (catchParameters != null) { | 1940     if (catchParameters != null) { | 
| 1941       if (catchParameters.required.length > 0) { | 1941       if (catchParameters.required.length > 0) { | 
| 1942         exception = catchParameters.required[0]; | 1942         exception = catchParameters.required[0]; | 
|  | 1943         exception.type = type; | 
| 1943       } | 1944       } | 
| 1944       if (catchParameters.required.length > 1) { | 1945       if (catchParameters.required.length > 1) { | 
| 1945         stackTrace = catchParameters.required[1]; | 1946         stackTrace = catchParameters.required[1]; | 
|  | 1947         stackTrace.type = coreTypes.stackTraceClass.rawType; | 
| 1946       } | 1948       } | 
| 1947       if (catchParameters.required.length > 2 || | 1949       if (catchParameters.required.length > 2 || | 
| 1948           catchParameters.optional != null) { | 1950           catchParameters.optional != null) { | 
| 1949         body = new Block(<Statement>[ | 1951         body = new Block(<Statement>[ | 
| 1950           compileTimeErrorInTry ??= buildCompileTimeErrorStatement( | 1952           compileTimeErrorInTry ??= buildCompileTimeErrorStatement( | 
| 1951               "Invalid catch arguments.", catchKeyword.next.charOffset) | 1953               "Invalid catch arguments.", catchKeyword.next.charOffset) | 
| 1952         ]); | 1954         ]); | 
| 1953       } | 1955       } | 
| 1954     } | 1956     } | 
| 1955     push(new Catch(exception, body, guard: type, stackTrace: stackTrace)); | 1957     push(new Catch(exception, body, guard: type, stackTrace: stackTrace)); | 
| 1956   } | 1958   } | 
| 1957 | 1959 | 
| 1958   @override | 1960   @override | 
| 1959   void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) { | 1961   void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) { | 
| 1960     Statement finallyBlock = popStatementIfNotNull(finallyKeyword); | 1962     Statement finallyBlock = popStatementIfNotNull(finallyKeyword); | 
| 1961     List<Catch> catches = popList(catchCount); | 1963     List<Catch> catches = popList(catchCount); | 
| 1962     Statement tryBlock = popStatement(); | 1964     Statement tryBlock = popStatement(); | 
| 1963     if (compileTimeErrorInTry == null) { | 1965     if (compileTimeErrorInTry == null) { | 
| 1964       if (catches != null) { | 1966       if (catches != null) { | 
| 1965         tryBlock = new TryCatch(tryBlock, catches); | 1967         tryBlock = new KernelTryCatch(tryBlock, catches); | 
| 1966       } | 1968       } | 
| 1967       if (finallyBlock != null) { | 1969       if (finallyBlock != null) { | 
| 1968         tryBlock = new TryFinally(tryBlock, finallyBlock); | 1970         tryBlock = new KernelTryFinally(tryBlock, finallyBlock); | 
| 1969       } | 1971       } | 
| 1970       push(tryBlock); | 1972       push(tryBlock); | 
| 1971     } else { | 1973     } else { | 
| 1972       push(compileTimeErrorInTry); | 1974       push(compileTimeErrorInTry); | 
| 1973       compileTimeErrorInTry = null; | 1975       compileTimeErrorInTry = null; | 
| 1974     } | 1976     } | 
| 1975   } | 1977   } | 
| 1976 | 1978 | 
| 1977   @override | 1979   @override | 
| 1978   void handleNoExpression(Token token) { | 1980   void handleNoExpression(Token token) { | 
| (...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3688     if (starToken == null) { | 3690     if (starToken == null) { | 
| 3689       return AsyncMarker.Async; | 3691       return AsyncMarker.Async; | 
| 3690     } else { | 3692     } else { | 
| 3691       assert(identical(starToken.stringValue, "*")); | 3693       assert(identical(starToken.stringValue, "*")); | 
| 3692       return AsyncMarker.AsyncStar; | 3694       return AsyncMarker.AsyncStar; | 
| 3693     } | 3695     } | 
| 3694   } else { | 3696   } else { | 
| 3695     return internalError("Unknown async modifier: $asyncToken"); | 3697     return internalError("Unknown async modifier: $asyncToken"); | 
| 3696   } | 3698   } | 
| 3697 } | 3699 } | 
| OLD | NEW | 
|---|