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

Side by Side Diff: pkg/compiler/lib/src/closure.dart

Issue 1069983005: Model 'await for' as an explicit node in tree and fix its handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix failing assertion rebase Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 closureToClassMapper; 5 library closureToClassMapper;
6 6
7 import "elements/elements.dart"; 7 import "elements/elements.dart";
8 import "dart2jslib.dart"; 8 import "dart2jslib.dart";
9 import "dart_types.dart"; 9 import "dart_types.dart";
10 import "js_backend/js_backend.dart" show JavaScriptBackend; 10 import "js_backend/js_backend.dart" show JavaScriptBackend;
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 } 1062 }
1063 1063
1064 visitTryStatement(TryStatement node) { 1064 visitTryStatement(TryStatement node) {
1065 // TODO(ngeoffray): implement finer grain state. 1065 // TODO(ngeoffray): implement finer grain state.
1066 bool oldInTryStatement = inTryStatement; 1066 bool oldInTryStatement = inTryStatement;
1067 inTryStatement = true; 1067 inTryStatement = true;
1068 node.visitChildren(this); 1068 node.visitChildren(this);
1069 inTryStatement = oldInTryStatement; 1069 inTryStatement = oldInTryStatement;
1070 } 1070 }
1071 1071
1072 visitForIn(ForIn node) { 1072 visitAsyncForIn(AsyncForIn node) {
1073 if (node.awaitToken != null) { 1073 // An `await for` loop is enclosed in an implicit try-finally.
1074 // An `await for` loop is enclosed in an implicit try-finally. 1074 bool oldInTryStatement = inTryStatement;
1075 bool oldInTryStatement = inTryStatement; 1075 inTryStatement = true;
1076 inTryStatement = true; 1076 visitLoop(node);
1077 visitLoop(node); 1077 inTryStatement = oldInTryStatement;
1078 inTryStatement = oldInTryStatement;
1079 } else {
1080 visitLoop(node);
1081 }
1082 } 1078 }
1083 } 1079 }
1084 1080
1085 /// A type variable as a local variable. 1081 /// A type variable as a local variable.
1086 class TypeVariableLocal implements Local { 1082 class TypeVariableLocal implements Local {
1087 final TypeVariableType typeVariable; 1083 final TypeVariableType typeVariable;
1088 final ExecutableElement executableContext; 1084 final ExecutableElement executableContext;
1089 1085
1090 TypeVariableLocal(this.typeVariable, this.executableContext); 1086 TypeVariableLocal(this.typeVariable, this.executableContext);
1091 1087
1092 String get name => typeVariable.name; 1088 String get name => typeVariable.name;
1093 1089
1094 int get hashCode => typeVariable.hashCode; 1090 int get hashCode => typeVariable.hashCode;
1095 1091
1096 bool operator ==(other) { 1092 bool operator ==(other) {
1097 if (other is! TypeVariableLocal) return false; 1093 if (other is! TypeVariableLocal) return false;
1098 return typeVariable == other.typeVariable; 1094 return typeVariable == other.typeVariable;
1099 } 1095 }
1100 } 1096 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698