| 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 kernel.transformations.continuation; | 5 library kernel.transformations.continuation; |
| 6 | 6 |
| 7 import 'dart:math' as math; | 7 import 'dart:math' as math; |
| 8 | 8 |
| 9 import '../ast.dart'; | 9 import '../ast.dart'; |
| 10 import '../core_types.dart'; | 10 import '../core_types.dart'; |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 | 814 |
| 815 // return :completer.future; | 815 // return :completer.future; |
| 816 var completerGet = new VariableGet(completerVariable); | 816 var completerGet = new VariableGet(completerVariable); |
| 817 var returnStatement = new ReturnStatement( | 817 var returnStatement = new ReturnStatement( |
| 818 new PropertyGet(completerGet, new Name('future', helper.asyncLibrary))); | 818 new PropertyGet(completerGet, new Name('future', helper.asyncLibrary))); |
| 819 statements.add(returnStatement); | 819 statements.add(returnStatement); |
| 820 | 820 |
| 821 enclosingFunction.body = new Block(statements); | 821 enclosingFunction.body = new Block(statements); |
| 822 enclosingFunction.body.parent = enclosingFunction; | 822 enclosingFunction.body.parent = enclosingFunction; |
| 823 enclosingFunction.asyncMarker = AsyncMarker.Sync; | 823 enclosingFunction.asyncMarker = AsyncMarker.Sync; |
| 824 enclosingFunction.debuggable = false; | |
| 825 return enclosingFunction; | 824 return enclosingFunction; |
| 826 } | 825 } |
| 827 | 826 |
| 828 Statement buildCatchBody(exceptionVariable, stackTraceVariable) { | 827 Statement buildCatchBody(exceptionVariable, stackTraceVariable) { |
| 829 return new ExpressionStatement(new MethodInvocation( | 828 return new ExpressionStatement(new MethodInvocation( |
| 830 new VariableGet(completerVariable), | 829 new VariableGet(completerVariable), |
| 831 new Name("completeError", helper.asyncLibrary), | 830 new Name("completeError", helper.asyncLibrary), |
| 832 new Arguments([ | 831 new Arguments([ |
| 833 new VariableGet(exceptionVariable), | 832 new VariableGet(exceptionVariable), |
| 834 new VariableGet(stackTraceVariable) | 833 new VariableGet(stackTraceVariable) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 findConstructor(syncIterableClass, ''), | 969 findConstructor(syncIterableClass, ''), |
| 971 findConstructor(streamIteratorClass, ''), | 970 findConstructor(streamIteratorClass, ''), |
| 972 findFactoryConstructor(futureClass, 'microtask'), | 971 findFactoryConstructor(futureClass, 'microtask'), |
| 973 findConstructor(streamControllerClass, ''), | 972 findConstructor(streamControllerClass, ''), |
| 974 findProcedure(asyncLibrary, '_asyncThenWrapperHelper'), | 973 findProcedure(asyncLibrary, '_asyncThenWrapperHelper'), |
| 975 findProcedure(asyncLibrary, '_asyncErrorWrapperHelper'), | 974 findProcedure(asyncLibrary, '_asyncErrorWrapperHelper'), |
| 976 findProcedure(asyncLibrary, '_awaitHelper'), | 975 findProcedure(asyncLibrary, '_awaitHelper'), |
| 977 new CoreTypes(program)); | 976 new CoreTypes(program)); |
| 978 } | 977 } |
| 979 } | 978 } |
| OLD | NEW |