Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: lib/transformations/continuation.dart

Issue 2502943002: Fix parent pointer issue in async rewriter. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/transformations/async.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « lib/transformations/async.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698