| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |