| 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, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 static const Name noSuchMethod_ = const PublicName(Identifiers.noSuchMethod_); | 65 static const Name noSuchMethod_ = const PublicName(Identifiers.noSuchMethod_); |
| 66 | 66 |
| 67 /// The name of the to-string method on 'Object'. | 67 /// The name of the to-string method on 'Object'. |
| 68 static const Name toString_ = const PublicName('toString'); | 68 static const Name toString_ = const PublicName('toString'); |
| 69 | 69 |
| 70 static const Name INDEX_NAME = const PublicName("[]"); | 70 static const Name INDEX_NAME = const PublicName("[]"); |
| 71 static const Name INDEX_SET_NAME = const PublicName("[]="); | 71 static const Name INDEX_SET_NAME = const PublicName("[]="); |
| 72 static const Name CALL_NAME = Names.call; | 72 static const Name CALL_NAME = Names.call; |
| 73 | 73 |
| 74 static const Name length = const PublicName(Identifiers.length); | 74 static const Name length = const PublicName(Identifiers.length); |
| 75 |
| 76 static const Name runtimeType_ = const PublicName(Identifiers.runtimeType_); |
| 75 } | 77 } |
| 76 | 78 |
| 77 /// [Selector]s commonly used. | 79 /// [Selector]s commonly used. |
| 78 class Selectors { | 80 class Selectors { |
| 79 /// The selector for calling the cancel method on 'StreamIterator'. | 81 /// The selector for calling the cancel method on 'StreamIterator'. |
| 80 static final Selector cancel = | 82 static final Selector cancel = |
| 81 new Selector.call(const PublicName('cancel'), CallStructure.NO_ARGS); | 83 new Selector.call(const PublicName('cancel'), CallStructure.NO_ARGS); |
| 82 | 84 |
| 83 /// The selector for getting the current element property used in for-each | 85 /// The selector for getting the current element property used in for-each |
| 84 /// loops. | 86 /// loops. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 107 | 109 |
| 108 static final Selector equals = new Selector.binaryOperator('=='); | 110 static final Selector equals = new Selector.binaryOperator('=='); |
| 109 | 111 |
| 110 static final Selector length = new Selector.getter(Names.length); | 112 static final Selector length = new Selector.getter(Names.length); |
| 111 | 113 |
| 112 static final Selector codeUnitAt = | 114 static final Selector codeUnitAt = |
| 113 new Selector.call(const PublicName('codeUnitAt'), CallStructure.ONE_ARG); | 115 new Selector.call(const PublicName('codeUnitAt'), CallStructure.ONE_ARG); |
| 114 | 116 |
| 115 static final Selector index = new Selector.index(); | 117 static final Selector index = new Selector.index(); |
| 116 | 118 |
| 119 static final Selector runtimeType_ = new Selector.getter(Names.runtimeType_); |
| 120 |
| 117 /// List of all the selectors held in static fields. | 121 /// List of all the selectors held in static fields. |
| 118 /// | 122 /// |
| 119 /// These objects are shared between different runs in batch-mode and must | 123 /// These objects are shared between different runs in batch-mode and must |
| 120 /// thus remain in the [Selector.canonicalizedValues] map. | 124 /// thus remain in the [Selector.canonicalizedValues] map. |
| 121 static final List<Selector> ALL = <Selector>[ | 125 static final List<Selector> ALL = <Selector>[ |
| 122 cancel, current, iterator, moveNext, noSuchMethod_, toString_, | 126 cancel, current, iterator, moveNext, noSuchMethod_, toString_, |
| 123 hashCode_, compareTo, equals, length, codeUnitAt, index]; | 127 hashCode_, compareTo, equals, length, codeUnitAt, index, runtimeType_]; |
| 124 } | 128 } |
| 125 | 129 |
| 126 /// [Uri]s commonly used. | 130 /// [Uri]s commonly used. |
| 127 class Uris { | 131 class Uris { |
| 128 /// The URI for 'dart:async'. | 132 /// The URI for 'dart:async'. |
| 129 static final Uri dart_async = new Uri(scheme: 'dart', path: 'async'); | 133 static final Uri dart_async = new Uri(scheme: 'dart', path: 'async'); |
| 130 | 134 |
| 131 /// The URI for 'dart:core'. | 135 /// The URI for 'dart:core'. |
| 132 static final Uri dart_core = new Uri(scheme: 'dart', path: 'core'); | 136 static final Uri dart_core = new Uri(scheme: 'dart', path: 'core'); |
| 133 | 137 |
| 134 /// The URI for 'dart:html'. | 138 /// The URI for 'dart:html'. |
| 135 static final Uri dart_html = new Uri(scheme: 'dart', path: 'html'); | 139 static final Uri dart_html = new Uri(scheme: 'dart', path: 'html'); |
| 136 | 140 |
| 137 /// The URI for 'dart:mirrors'. | 141 /// The URI for 'dart:mirrors'. |
| 138 static final Uri dart_mirrors = new Uri(scheme: 'dart', path: 'mirrors'); | 142 static final Uri dart_mirrors = new Uri(scheme: 'dart', path: 'mirrors'); |
| 139 | 143 |
| 140 /// The URI for 'dart:_internal'. | 144 /// The URI for 'dart:_internal'. |
| 141 static final Uri dart__internal = new Uri(scheme: 'dart', path: '_internal'); | 145 static final Uri dart__internal = new Uri(scheme: 'dart', path: '_internal'); |
| 142 | 146 |
| 143 /// The URI for 'dart:_native_typed_data'. | 147 /// The URI for 'dart:_native_typed_data'. |
| 144 static final Uri dart__native_typed_data = | 148 static final Uri dart__native_typed_data = |
| 145 new Uri(scheme: 'dart', path: '_native_typed_data'); | 149 new Uri(scheme: 'dart', path: '_native_typed_data'); |
| 146 } | 150 } |
| OLD | NEW |