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 'dart:uri'; | 7 import 'dart:uri'; |
8 | 8 |
9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed. | 9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed. |
10 import '../../compiler.dart' as api_e; | 10 import '../../compiler.dart' as api_e; |
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 */ | 1754 */ |
1755 bool isSubclassOf(ClassElement cls) { | 1755 bool isSubclassOf(ClassElement cls) { |
1756 for (ClassElement s = this; s != null; s = s.superclass) { | 1756 for (ClassElement s = this; s != null; s = s.superclass) { |
1757 if (identical(s, cls)) return true; | 1757 if (identical(s, cls)) return true; |
1758 } | 1758 } |
1759 return false; | 1759 return false; |
1760 } | 1760 } |
1761 | 1761 |
1762 bool isInterface() => false; | 1762 bool isInterface() => false; |
1763 bool isNative() => nativeTagInfo != null; | 1763 bool isNative() => nativeTagInfo != null; |
1764 void setNative(String name) { | |
1765 nativeTagInfo = new SourceString(name); | |
1766 } | |
1767 int get hashCode => id; | 1764 int get hashCode => id; |
1768 | 1765 |
1769 Scope buildScope() => new ClassScope(enclosingElement.buildScope(), this); | 1766 Scope buildScope() => new ClassScope(enclosingElement.buildScope(), this); |
1770 | 1767 |
1771 String toString() { | 1768 String toString() { |
1772 if (origin != null) { | 1769 if (origin != null) { |
1773 return 'patch ${super.toString()}'; | 1770 return 'patch ${super.toString()}'; |
1774 } else if (patch != null) { | 1771 } else if (patch != null) { |
1775 return 'origin ${super.toString()}'; | 1772 return 'origin ${super.toString()}'; |
1776 } else { | 1773 } else { |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2132 | 2129 |
2133 MetadataAnnotation ensureResolved(Compiler compiler) { | 2130 MetadataAnnotation ensureResolved(Compiler compiler) { |
2134 if (resolutionState == STATE_NOT_STARTED) { | 2131 if (resolutionState == STATE_NOT_STARTED) { |
2135 compiler.resolver.resolveMetadataAnnotation(this); | 2132 compiler.resolver.resolveMetadataAnnotation(this); |
2136 } | 2133 } |
2137 return this; | 2134 return this; |
2138 } | 2135 } |
2139 | 2136 |
2140 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 2137 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
2141 } | 2138 } |
OLD | NEW |