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 dart2js.resolution; | 5 library dart2js.resolution; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 // Get the resolution tree and check that the resolved | 264 // Get the resolution tree and check that the resolved |
265 // function doesn't use 'super' if it is mixed into another | 265 // function doesn't use 'super' if it is mixed into another |
266 // class. This is the part of the 'super' mixin check that | 266 // class. This is the part of the 'super' mixin check that |
267 // happens when a function is resolved after the mixin | 267 // happens when a function is resolved after the mixin |
268 // application has been performed. | 268 // application has been performed. |
269 TreeElements resolutionTree = registry.mapping; | 269 TreeElements resolutionTree = registry.mapping; |
270 ClassElement enclosingClass = element.enclosingClass; | 270 ClassElement enclosingClass = element.enclosingClass; |
271 if (enclosingClass != null) { | 271 if (enclosingClass != null) { |
272 // TODO(johnniwinther): Find another way to obtain mixin uses. | 272 // TODO(johnniwinther): Find another way to obtain mixin uses. |
273 Iterable<MixinApplicationElement> mixinUses = | |
274 world.allMixinUsesOf(enclosingClass); | |
275 ClassElement mixin = enclosingClass; | 273 ClassElement mixin = enclosingClass; |
276 for (MixinApplicationElement mixinApplication in mixinUses) { | 274 for (MixinApplicationElement mixinApplication |
| 275 in world.allMixinUsesOf(enclosingClass)) { |
277 checkMixinSuperUses(resolutionTree, mixinApplication, mixin); | 276 checkMixinSuperUses(resolutionTree, mixinApplication, mixin); |
278 } | 277 } |
279 } | 278 } |
280 | 279 |
281 // TODO(9631): support noSuchMethod on native classes. | 280 // TODO(9631): support noSuchMethod on native classes. |
282 if (element.isFunction && | 281 if (element.isFunction && |
283 element.isInstanceMember && | 282 element.isInstanceMember && |
284 element.name == Identifiers.noSuchMethod_ && | 283 element.name == Identifiers.noSuchMethod_ && |
285 _isNativeClassOrExtendsNativeClass(enclosingClass)) { | 284 _isNativeClassOrExtendsNativeClass(enclosingClass)) { |
286 reporter.reportErrorMessage(tree, MessageKind.NO_SUCH_METHOD_IN_NATIVE); | 285 reporter.reportErrorMessage(tree, MessageKind.NO_SUCH_METHOD_IN_NATIVE); |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 TreeElements get treeElements { | 1143 TreeElements get treeElements { |
1145 assert(invariant(this, _treeElements != null, | 1144 assert(invariant(this, _treeElements != null, |
1146 message: "TreeElements have not been computed for $this.")); | 1145 message: "TreeElements have not been computed for $this.")); |
1147 return _treeElements; | 1146 return _treeElements; |
1148 } | 1147 } |
1149 | 1148 |
1150 void reuseElement() { | 1149 void reuseElement() { |
1151 _treeElements = null; | 1150 _treeElements = null; |
1152 } | 1151 } |
1153 } | 1152 } |
OLD | NEW |