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 containing identifier, names, and selectors commonly used through | 5 /// Library containing identifier, names, and selectors commonly used through |
6 /// the compiler. | 6 /// the compiler. |
7 library dart2js.common.names; | 7 library dart2js.common.names; |
8 | 8 |
9 import '../elements/elements.dart' show | 9 import '../elements/elements.dart' show |
10 Name, | 10 Name, |
11 PublicName; | 11 PublicName; |
12 import '../universe/universe.dart' show | 12 import '../universe/universe.dart' show |
13 CallStructure, | 13 CallStructure, |
14 Selector; | 14 Selector; |
15 | 15 |
16 /// [String]s commonly used. | 16 /// [String]s commonly used. |
17 class Identifiers { | 17 class Identifiers { |
18 /// The name of the call operator. | 18 /// The name of the call operator. |
19 static const String call = 'call'; | 19 static const String call = 'call'; |
20 | 20 |
| 21 /// The name of the current element property used on iterators in for-each |
| 22 /// loops. |
| 23 static const String current = 'current'; |
| 24 |
21 /// The name of the from environment constructors on 'int', 'bool' and | 25 /// The name of the from environment constructors on 'int', 'bool' and |
22 /// 'String'. | 26 /// 'String'. |
23 static const String fromEnvironment = 'fromEnvironment'; | 27 static const String fromEnvironment = 'fromEnvironment'; |
24 | 28 |
| 29 /// The name of the iterator property used in for-each loops. |
| 30 static const String iterator = 'iterator'; |
| 31 |
25 /// The name of the main method. | 32 /// The name of the main method. |
26 static const String main = 'main'; | 33 static const String main = 'main'; |
27 | 34 |
28 /// The name of the no such method handler on 'Object'. | 35 /// The name of the no such method handler on 'Object'. |
29 static const String noSuchMethod_ = 'noSuchMethod'; | 36 static const String noSuchMethod_ = 'noSuchMethod'; |
30 | 37 |
31 /// The name of the runtime type property on 'Object'. | 38 /// The name of the runtime type property on 'Object'. |
32 static const String runtimeType_ = 'runtimeType'; | 39 static const String runtimeType_ = 'runtimeType'; |
33 } | 40 } |
34 | 41 |
35 /// [Name]s commonly used. | 42 /// [Name]s commonly used. |
36 class Names { | 43 class Names { |
37 /// The name of the call operator. | 44 /// The name of the call operator. |
38 static const Name call = const PublicName(Identifiers.call); | 45 static const Name call = const PublicName(Identifiers.call); |
39 | 46 |
40 /// The name of the current element property used on iterators in for-each | 47 /// The name of the current element property used on iterators in for-each |
41 /// loops. | 48 /// loops. |
42 static const Name current = const PublicName('current'); | 49 static const Name current = const PublicName(Identifiers.current); |
43 | 50 |
44 /// The name of the dynamic type. | 51 /// The name of the dynamic type. |
45 static const Name dynamic_ = const PublicName('dynamic'); | 52 static const Name dynamic_ = const PublicName('dynamic'); |
46 | 53 |
47 /// The name of the iterator property used in for-each loops. | 54 /// The name of the iterator property used in for-each loops. |
48 static const Name iterator = const PublicName('iterator'); | 55 static const Name iterator = const PublicName(Identifiers.iterator); |
49 | 56 |
50 /// The name of the move next method used on iterators in for-each loops. | 57 /// The name of the move next method used on iterators in for-each loops. |
51 static const Name moveNext = const PublicName('moveNext'); | 58 static const Name moveNext = const PublicName('moveNext'); |
52 | 59 |
53 /// The name of the no such method handler on 'Object'. | 60 /// The name of the no such method handler on 'Object'. |
54 static const Name noSuchMethod_ = const PublicName(Identifiers.noSuchMethod_); | 61 static const Name noSuchMethod_ = const PublicName(Identifiers.noSuchMethod_); |
55 | 62 |
56 /// The name of the to-string method on 'Object'. | 63 /// The name of the to-string method on 'Object'. |
57 static const Name toString_ = const PublicName('toString'); | 64 static const Name toString_ = const PublicName('toString'); |
58 } | 65 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 /// The URI for 'dart:mirrors'. | 112 /// The URI for 'dart:mirrors'. |
106 static final Uri dart_mirrors = new Uri(scheme: 'dart', path: 'mirrors'); | 113 static final Uri dart_mirrors = new Uri(scheme: 'dart', path: 'mirrors'); |
107 | 114 |
108 /// The URI for 'dart:_internal'. | 115 /// The URI for 'dart:_internal'. |
109 static final Uri dart__internal = new Uri(scheme: 'dart', path: '_internal'); | 116 static final Uri dart__internal = new Uri(scheme: 'dart', path: '_internal'); |
110 | 117 |
111 /// The URI for 'dart:_native_typed_data'. | 118 /// The URI for 'dart:_native_typed_data'. |
112 static final Uri dart__native_typed_data = | 119 static final Uri dart__native_typed_data = |
113 new Uri(scheme: 'dart', path: '_native_typed_data'); | 120 new Uri(scheme: 'dart', path: '_native_typed_data'); |
114 } | 121 } |
OLD | NEW |