OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.class_hierarchy; | 5 library dart2js.resolution.class_hierarchy; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show Feature; | 8 import '../common/resolution.dart' show Feature; |
9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
10 import '../core_types.dart' show CoreClasses, CoreTypes; | 10 import '../core_types.dart' show CoreClasses, CoreTypes; |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } else { | 550 } else { |
551 assert(cls == compiler.coreClasses.objectClass); | 551 assert(cls == compiler.coreClasses.objectClass); |
552 cls.allSupertypesAndSelf = | 552 cls.allSupertypesAndSelf = |
553 new OrderedTypeSet.singleton(cls.computeType(resolution)); | 553 new OrderedTypeSet.singleton(cls.computeType(resolution)); |
554 } | 554 } |
555 } | 555 } |
556 | 556 |
557 isBlackListed(DartType type) { | 557 isBlackListed(DartType type) { |
558 LibraryElement lib = element.library; | 558 LibraryElement lib = element.library; |
559 return !identical(lib, compiler.coreLibrary) && | 559 return !identical(lib, compiler.coreLibrary) && |
560 !compiler.backend.isBackendLibrary(lib) && | 560 !resolution.target.isTargetSpecificLibrary(lib) && |
561 (type.isDynamic || | 561 (type.isDynamic || |
562 type == coreTypes.boolType || | 562 type == coreTypes.boolType || |
563 type == coreTypes.numType || | 563 type == coreTypes.numType || |
564 type == coreTypes.intType || | 564 type == coreTypes.intType || |
565 type == coreTypes.doubleType || | 565 type == coreTypes.doubleType || |
566 type == coreTypes.stringType || | 566 type == coreTypes.stringType || |
567 type == coreTypes.nullType); | 567 type == coreTypes.nullType); |
568 } | 568 } |
569 } | 569 } |
570 | 570 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 Identifier selector = node.selector.asIdentifier(); | 648 Identifier selector = node.selector.asIdentifier(); |
649 var e = prefixElement.lookupLocalMember(selector.source); | 649 var e = prefixElement.lookupLocalMember(selector.source); |
650 if (e == null || !e.impliesType) { | 650 if (e == null || !e.impliesType) { |
651 reporter.reportErrorMessage(node.selector, | 651 reporter.reportErrorMessage(node.selector, |
652 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); | 652 MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.selector}); |
653 return; | 653 return; |
654 } | 654 } |
655 loadSupertype(e, node); | 655 loadSupertype(e, node); |
656 } | 656 } |
657 } | 657 } |
OLD | NEW |