| 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 elements; | 5 library elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Resolution; | 8 import '../common/resolution.dart' show Resolution; |
| 9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../constants/constructors.dart'; | 10 import '../constants/constructors.dart'; |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 | 794 |
| 795 static bool isConstructorOfTypedArraySubclass( | 795 static bool isConstructorOfTypedArraySubclass( |
| 796 Element element, Compiler compiler) { | 796 Element element, Compiler compiler) { |
| 797 if (compiler.commonElements.typedDataLibrary == null) return false; | 797 if (compiler.commonElements.typedDataLibrary == null) return false; |
| 798 if (!element.isConstructor) return false; | 798 if (!element.isConstructor) return false; |
| 799 ConstructorElement constructor = element.implementation; | 799 ConstructorElement constructor = element.implementation; |
| 800 constructor = constructor.effectiveTarget; | 800 constructor = constructor.effectiveTarget; |
| 801 ClassElement cls = constructor.enclosingClass; | 801 ClassElement cls = constructor.enclosingClass; |
| 802 return cls.library == compiler.commonElements.typedDataLibrary && | 802 return cls.library == compiler.commonElements.typedDataLibrary && |
| 803 compiler.backend.isNative(cls) && | 803 compiler.backend.isNative(cls) && |
| 804 compiler.world | 804 compiler.closedWorld |
| 805 .isSubtypeOf(cls, compiler.commonElements.typedDataClass) && | 805 .isSubtypeOf(cls, compiler.commonElements.typedDataClass) && |
| 806 compiler.world.isSubtypeOf(cls, compiler.coreClasses.listClass) && | 806 compiler.closedWorld.isSubtypeOf(cls, compiler.coreClasses.listClass) && |
| 807 constructor.name == ''; | 807 constructor.name == ''; |
| 808 } | 808 } |
| 809 | 809 |
| 810 static bool switchStatementHasContinue( | 810 static bool switchStatementHasContinue( |
| 811 SwitchStatement node, TreeElements elements) { | 811 SwitchStatement node, TreeElements elements) { |
| 812 for (SwitchCase switchCase in node.cases) { | 812 for (SwitchCase switchCase in node.cases) { |
| 813 for (Node labelOrCase in switchCase.labelsAndCases) { | 813 for (Node labelOrCase in switchCase.labelsAndCases) { |
| 814 Node label = labelOrCase.asLabel(); | 814 Node label = labelOrCase.asLabel(); |
| 815 if (label != null) { | 815 if (label != null) { |
| 816 LabelDefinition labelElement = elements.getLabelDefinition(label); | 816 LabelDefinition labelElement = elements.getLabelDefinition(label); |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 /// by a field. | 1908 /// by a field. |
| 1909 bool get isDeclaredByField; | 1909 bool get isDeclaredByField; |
| 1910 | 1910 |
| 1911 /// Returns `true` if this member is abstract. | 1911 /// Returns `true` if this member is abstract. |
| 1912 bool get isAbstract; | 1912 bool get isAbstract; |
| 1913 | 1913 |
| 1914 /// If abstract, [implementation] points to the overridden concrete member, | 1914 /// If abstract, [implementation] points to the overridden concrete member, |
| 1915 /// if any. Otherwise [implementation] points to the member itself. | 1915 /// if any. Otherwise [implementation] points to the member itself. |
| 1916 Member get implementation; | 1916 Member get implementation; |
| 1917 } | 1917 } |
| OLD | NEW |