| 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/names.dart' show |
| 10 Identifiers; |
| 9 import '../common/tasks.dart' show | 11 import '../common/tasks.dart' show |
| 10 CompilerTask, | 12 CompilerTask, |
| 11 DeferredAction; | 13 DeferredAction; |
| 12 import '../compiler.dart' show | 14 import '../compiler.dart' show |
| 13 Compiler; | 15 Compiler; |
| 14 import '../compile_time_constants.dart' show | 16 import '../compile_time_constants.dart' show |
| 15 ConstantCompiler; | 17 ConstantCompiler; |
| 16 import '../constants/values.dart' show | 18 import '../constants/values.dart' show |
| 17 ConstantValue; | 19 ConstantValue; |
| 18 import '../dart_types.dart'; | 20 import '../dart_types.dart'; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 Iterable<MixinApplicationElement> mixinUses = | 244 Iterable<MixinApplicationElement> mixinUses = |
| 243 compiler.world.allMixinUsesOf(enclosingClass); | 245 compiler.world.allMixinUsesOf(enclosingClass); |
| 244 ClassElement mixin = enclosingClass; | 246 ClassElement mixin = enclosingClass; |
| 245 for (MixinApplicationElement mixinApplication in mixinUses) { | 247 for (MixinApplicationElement mixinApplication in mixinUses) { |
| 246 checkMixinSuperUses(resolutionTree, mixinApplication, mixin); | 248 checkMixinSuperUses(resolutionTree, mixinApplication, mixin); |
| 247 } | 249 } |
| 248 } | 250 } |
| 249 | 251 |
| 250 // TODO(9631): support noSuchMethod on native classes. | 252 // TODO(9631): support noSuchMethod on native classes. |
| 251 if (Elements.isInstanceMethod(element) && | 253 if (Elements.isInstanceMethod(element) && |
| 252 element.name == Compiler.NO_SUCH_METHOD && | 254 element.name == Identifiers.noSuchMethod_ && |
| 253 _isNativeClassOrExtendsNativeClass(enclosingClass)) { | 255 _isNativeClassOrExtendsNativeClass(enclosingClass)) { |
| 254 error(tree, MessageKind.NO_SUCH_METHOD_IN_NATIVE); | 256 error(tree, MessageKind.NO_SUCH_METHOD_IN_NATIVE); |
| 255 } | 257 } |
| 256 | 258 |
| 257 return registry.worldImpact; | 259 return registry.worldImpact; |
| 258 }); | 260 }); |
| 259 | 261 |
| 260 } | 262 } |
| 261 | 263 |
| 262 WorldImpact resolveMethodElement(FunctionElementX element) { | 264 WorldImpact resolveMethodElement(FunctionElementX element) { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 element.forEachMember((_, Element member) { | 611 element.forEachMember((_, Element member) { |
| 610 if (!member.isInstanceMember) { | 612 if (!member.isInstanceMember) { |
| 611 compiler.withCurrentElement(member, () { | 613 compiler.withCurrentElement(member, () { |
| 612 for (MetadataAnnotation metadata in member.metadata) { | 614 for (MetadataAnnotation metadata in member.metadata) { |
| 613 metadata.ensureResolved(compiler); | 615 metadata.ensureResolved(compiler); |
| 614 } | 616 } |
| 615 }); | 617 }); |
| 616 } | 618 } |
| 617 }); | 619 }); |
| 618 | 620 |
| 619 computeClassMember(element, Compiler.CALL_OPERATOR_NAME); | 621 computeClassMember(element, Identifiers.call); |
| 620 } | 622 } |
| 621 | 623 |
| 622 void computeClassMembers(ClassElement element) { | 624 void computeClassMembers(ClassElement element) { |
| 623 MembersCreator.computeAllClassMembers(compiler, element); | 625 MembersCreator.computeAllClassMembers(compiler, element); |
| 624 } | 626 } |
| 625 | 627 |
| 626 void computeClassMember(ClassElement element, String name) { | 628 void computeClassMember(ClassElement element, String name) { |
| 627 MembersCreator.computeClassMembersByName(compiler, element, name); | 629 MembersCreator.computeClassMembersByName(compiler, element, name); |
| 628 } | 630 } |
| 629 | 631 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 TreeElements get treeElements { | 1038 TreeElements get treeElements { |
| 1037 assert(invariant(this, _treeElements !=null, | 1039 assert(invariant(this, _treeElements !=null, |
| 1038 message: "TreeElements have not been computed for $this.")); | 1040 message: "TreeElements have not been computed for $this.")); |
| 1039 return _treeElements; | 1041 return _treeElements; |
| 1040 } | 1042 } |
| 1041 | 1043 |
| 1042 void reuseElement() { | 1044 void reuseElement() { |
| 1043 _treeElements = null; | 1045 _treeElements = null; |
| 1044 } | 1046 } |
| 1045 } | 1047 } |
| OLD | NEW |