OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 inferrer_visitor; | 5 library inferrer_visitor; |
6 | 6 |
7 import 'dart:collection' show IterableMixin; | 7 import 'dart:collection' show IterableMixin; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 bool isThisOrSuper(Node node) => node.isThis() || node.isSuper(); | 943 bool isThisOrSuper(Node node) => node.isThis() || node.isSuper(); |
944 | 944 |
945 Element get outermostElement { | 945 Element get outermostElement { |
946 return analyzedElement.outermostEnclosingMemberOrTopLevel.implementation; | 946 return analyzedElement.outermostEnclosingMemberOrTopLevel.implementation; |
947 } | 947 } |
948 | 948 |
949 T _thisType; | 949 T _thisType; |
950 T get thisType { | 950 T get thisType { |
951 if (_thisType != null) return _thisType; | 951 if (_thisType != null) return _thisType; |
952 ClassElement cls = outermostElement.enclosingClass; | 952 ClassElement cls = outermostElement.enclosingClass; |
953 ClassWorld classWorld = compiler.world; | 953 ClassWorld classWorld = compiler.closedWorld; |
954 if (classWorld.isUsedAsMixin(cls)) { | 954 if (classWorld.isUsedAsMixin(cls)) { |
955 return _thisType = types.nonNullSubtype(cls); | 955 return _thisType = types.nonNullSubtype(cls); |
956 } else { | 956 } else { |
957 return _thisType = types.nonNullSubclass(cls); | 957 return _thisType = types.nonNullSubclass(cls); |
958 } | 958 } |
959 } | 959 } |
960 | 960 |
961 T _superType; | 961 T _superType; |
962 T get superType { | 962 T get superType { |
963 if (_superType != null) return _superType; | 963 if (_superType != null) return _superType; |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 return type; | 1484 return type; |
1485 } | 1485 } |
1486 | 1486 |
1487 T visitCascade(Cascade node) { | 1487 T visitCascade(Cascade node) { |
1488 // Ignore the result of the cascade send and return the type of the cascade | 1488 // Ignore the result of the cascade send and return the type of the cascade |
1489 // receiver. | 1489 // receiver. |
1490 visit(node.expression); | 1490 visit(node.expression); |
1491 return cascadeReceiverStack.removeLast(); | 1491 return cascadeReceiverStack.removeLast(); |
1492 } | 1492 } |
1493 } | 1493 } |
OLD | NEW |