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

Side by Side Diff: pkg/compiler/lib/src/js/rewrite_async.dart

Issue 2944843002: All strong mode cleaning of dart2js. (Closed)
Patch Set: More issues discovered during testing. Created 3 years, 6 months 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 rewrite_async; 5 library rewrite_async;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show max; 8 import 'dart:math' show max;
9 9
10 import 'package:js_runtime/shared/async_await_error_codes.dart' as error_codes; 10 import 'package:js_runtime/shared/async_await_error_codes.dart' as error_codes;
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 /// Also [nextWhenCanceled] is set up to contain the finally blocks that 2029 /// Also [nextWhenCanceled] is set up to contain the finally blocks that
2030 /// must be run in case the stream was canceled. 2030 /// must be run in case the stream was canceled.
2031 @override 2031 @override
2032 void addYield(js.DartYield node, js.Expression expression) { 2032 void addYield(js.DartYield node, js.Expression expression) {
2033 // Find all the finally blocks that should be performed if the stream is 2033 // Find all the finally blocks that should be performed if the stream is
2034 // canceled during the yield. 2034 // canceled during the yield.
2035 // At the bottom of the stack is the return label. 2035 // At the bottom of the stack is the return label.
2036 List<int> enclosingFinallyLabels = <int>[exitLabel]; 2036 List<int> enclosingFinallyLabels = <int>[exitLabel];
2037 enclosingFinallyLabels.addAll(jumpTargets 2037 enclosingFinallyLabels.addAll(jumpTargets
2038 .where((js.Node node) => finallyLabels[node] != null) 2038 .where((js.Node node) => finallyLabels[node] != null)
2039 .map((js.Block node) => finallyLabels[node])); 2039 .map((js.Node node) => finallyLabels[node]));
2040 addStatement(js.js.statement("# = #;", [ 2040 addStatement(js.js.statement("# = #;", [
2041 nextWhenCanceled, 2041 nextWhenCanceled,
2042 new js.ArrayInitializer(enclosingFinallyLabels.map(js.number).toList()) 2042 new js.ArrayInitializer(enclosingFinallyLabels.map(js.number).toList())
2043 ])); 2043 ]));
2044 addStatement(js.js.statement( 2044 addStatement(js.js.statement(
2045 """ 2045 """
2046 return #asyncStarHelper(#yieldExpression(#expression), #bodyName, 2046 return #asyncStarHelper(#yieldExpression(#expression), #bodyName,
2047 #controller);""", 2047 #controller);""",
2048 { 2048 {
2049 "asyncStarHelper": asyncStarHelper, 2049 "asyncStarHelper": asyncStarHelper,
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 return condition || body; 2614 return condition || body;
2615 } 2615 }
2616 2616
2617 @override 2617 @override
2618 bool visitDartYield(js.DartYield node) { 2618 bool visitDartYield(js.DartYield node) {
2619 hasYield = true; 2619 hasYield = true;
2620 visit(node.expression); 2620 visit(node.expression);
2621 return true; 2621 return true;
2622 } 2622 }
2623 } 2623 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/io/source_information.dart ('k') | pkg/compiler/lib/src/js_backend/backend_serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698