| 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 'common.dart'; | 7 import 'common.dart'; |
| 8 import 'common/names.dart' show Identifiers; | 8 import 'common/names.dart' show Identifiers; |
| 9 import 'common/resolution.dart' show ParsingContext, Resolution; | 9 import 'common/resolution.dart' show ParsingContext, Resolution; |
| 10 import 'common/tasks.dart' show CompilerTask; | 10 import 'common/tasks.dart' show CompilerTask; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 accept(ElementVisitor visitor, arg) { | 164 accept(ElementVisitor visitor, arg) { |
| 165 return visitor.visitClosureFieldElement(this, arg); | 165 return visitor.visitClosureFieldElement(this, arg); |
| 166 } | 166 } |
| 167 | 167 |
| 168 Element get analyzableElement => closureClass.methodElement.analyzableElement; | 168 Element get analyzableElement => closureClass.methodElement.analyzableElement; |
| 169 | 169 |
| 170 @override | 170 @override |
| 171 List<FunctionElement> get nestedClosures => const <FunctionElement>[]; | 171 List<FunctionElement> get nestedClosures => const <FunctionElement>[]; |
| 172 | 172 |
| 173 @override | 173 @override |
| 174 bool get hasConstant => false; |
| 175 |
| 176 @override |
| 174 ConstantExpression get constant => null; | 177 ConstantExpression get constant => null; |
| 175 } | 178 } |
| 176 | 179 |
| 177 // TODO(ahe): These classes continuously cause problems. We need to find | 180 // TODO(ahe): These classes continuously cause problems. We need to find |
| 178 // a more general solution. | 181 // a more general solution. |
| 179 class ClosureClassElement extends ClassElementX { | 182 class ClosureClassElement extends ClassElementX { |
| 180 DartType rawType; | 183 DartType rawType; |
| 181 DartType thisType; | 184 DartType thisType; |
| 182 FunctionType callType; | 185 FunctionType callType; |
| 183 | 186 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 Node get node { | 306 Node get node { |
| 304 throw new UnsupportedError("BoxFieldElement.node"); | 307 throw new UnsupportedError("BoxFieldElement.node"); |
| 305 } | 308 } |
| 306 | 309 |
| 307 @override | 310 @override |
| 308 ResolvedAst get resolvedAst { | 311 ResolvedAst get resolvedAst { |
| 309 throw new UnsupportedError("BoxFieldElement.resolvedAst"); | 312 throw new UnsupportedError("BoxFieldElement.resolvedAst"); |
| 310 } | 313 } |
| 311 | 314 |
| 312 @override | 315 @override |
| 316 bool get hasConstant => false; |
| 317 |
| 318 @override |
| 313 ConstantExpression get constant => null; | 319 ConstantExpression get constant => null; |
| 314 } | 320 } |
| 315 | 321 |
| 316 /// A local variable used encode the direct (uncaptured) references to [this]. | 322 /// A local variable used encode the direct (uncaptured) references to [this]. |
| 317 class ThisLocal extends Local { | 323 class ThisLocal extends Local { |
| 318 final ExecutableElement executableContext; | 324 final ExecutableElement executableContext; |
| 319 final hashCode = ++ElementX.elementHashCode; | 325 final hashCode = ++ElementX.elementHashCode; |
| 320 | 326 |
| 321 ThisLocal(this.executableContext); | 327 ThisLocal(this.executableContext); |
| 322 | 328 |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 /// | 1185 /// |
| 1180 /// Move the below classes to a JS model eventually. | 1186 /// Move the below classes to a JS model eventually. |
| 1181 /// | 1187 /// |
| 1182 abstract class JSEntity implements Entity { | 1188 abstract class JSEntity implements Entity { |
| 1183 Entity get declaredEntity; | 1189 Entity get declaredEntity; |
| 1184 } | 1190 } |
| 1185 | 1191 |
| 1186 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1192 abstract class PrivatelyNamedJSEntity implements JSEntity { |
| 1187 Entity get rootOfScope; | 1193 Entity get rootOfScope; |
| 1188 } | 1194 } |
| OLD | NEW |