| 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 '../visitor.dart'; | 10 import '../visitor.dart'; |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 492 |
| 493 LabeledStatement labeled = new LabeledStatement(null); | 493 LabeledStatement labeled = new LabeledStatement(null); |
| 494 if (cond != null) { | 494 if (cond != null) { |
| 495 loopBody.addAll(condEffects); | 495 loopBody.addAll(condEffects); |
| 496 } else { | 496 } else { |
| 497 cond = new BoolLiteral(true); | 497 cond = new BoolLiteral(true); |
| 498 } | 498 } |
| 499 loopBody.add( | 499 loopBody.add( |
| 500 new IfStatement(cond, new Block(newBody), new BreakStatement(labeled))); | 500 new IfStatement(cond, new Block(newBody), new BreakStatement(labeled))); |
| 501 labeled.body = | 501 labeled.body = |
| 502 new WhileStatement(new BoolLiteral(true), new Block(loopBody)); | 502 new WhileStatement(new BoolLiteral(true), new Block(loopBody)) |
| 503 ..parent = labeled; |
| 503 statements.add(new Block(<Statement>[] | 504 statements.add(new Block(<Statement>[] |
| 504 ..addAll(temps) | 505 ..addAll(temps) |
| 505 ..add(labeled))); | 506 ..add(labeled))); |
| 506 return null; | 507 return null; |
| 507 } | 508 } |
| 508 | 509 |
| 509 TreeNode visitForInStatement(ForInStatement stmt) { | 510 TreeNode visitForInStatement(ForInStatement stmt) { |
| 510 if (stmt.isAsync) { | 511 if (stmt.isAsync) { |
| 511 // Transform | 512 // Transform |
| 512 // | 513 // |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 findFactoryConstructor(completerClass, 'sync'), | 890 findFactoryConstructor(completerClass, 'sync'), |
| 890 findConstructor(syncIterableClass, ''), | 891 findConstructor(syncIterableClass, ''), |
| 891 findConstructor(streamIteratorClass, ''), | 892 findConstructor(streamIteratorClass, ''), |
| 892 findFactoryConstructor(futureClass, 'microtask'), | 893 findFactoryConstructor(futureClass, 'microtask'), |
| 893 findConstructor(streamControllerClass, ''), | 894 findConstructor(streamControllerClass, ''), |
| 894 findProcedure(asyncLibrary, '_asyncThenWrapperHelper'), | 895 findProcedure(asyncLibrary, '_asyncThenWrapperHelper'), |
| 895 findProcedure(asyncLibrary, '_asyncErrorWrapperHelper'), | 896 findProcedure(asyncLibrary, '_asyncErrorWrapperHelper'), |
| 896 findProcedure(asyncLibrary, '_awaitHelper')); | 897 findProcedure(asyncLibrary, '_awaitHelper')); |
| 897 } | 898 } |
| 898 } | 899 } |
| OLD | NEW |