| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 static final Selector iterator = new Selector.getter(Names.iterator); | 90 static final Selector iterator = new Selector.getter(Names.iterator); |
| 91 | 91 |
| 92 /// The selector for calling the move next method used in for-each loops. | 92 /// The selector for calling the move next method used in for-each loops. |
| 93 static final Selector moveNext = | 93 static final Selector moveNext = |
| 94 new Selector.call(Names.moveNext, CallStructure.NO_ARGS); | 94 new Selector.call(Names.moveNext, CallStructure.NO_ARGS); |
| 95 | 95 |
| 96 /// The selector for calling the no such method handler on 'Object'. | 96 /// The selector for calling the no such method handler on 'Object'. |
| 97 static final Selector noSuchMethod_ = | 97 static final Selector noSuchMethod_ = |
| 98 new Selector.call(Names.noSuchMethod_, CallStructure.ONE_ARG); | 98 new Selector.call(Names.noSuchMethod_, CallStructure.ONE_ARG); |
| 99 | 99 |
| 100 /// The selector for tearing off noSuchMethod. |
| 101 static final Selector noSuchMethodGetter = |
| 102 new Selector.getter(Names.noSuchMethod_); |
| 103 |
| 100 /// The selector for calling the to-string method on 'Object'. | 104 /// The selector for calling the to-string method on 'Object'. |
| 101 static final Selector toString_ = | 105 static final Selector toString_ = |
| 102 new Selector.call(Names.toString_, CallStructure.NO_ARGS); | 106 new Selector.call(Names.toString_, CallStructure.NO_ARGS); |
| 103 | 107 |
| 108 /// The selector for tearing off toString. |
| 109 static final Selector toStringGetter = |
| 110 new Selector.getter(Names.toString_); |
| 111 |
| 104 static final Selector hashCode_ = | 112 static final Selector hashCode_ = |
| 105 new Selector.getter(const PublicName('hashCode')); | 113 new Selector.getter(const PublicName('hashCode')); |
| 106 | 114 |
| 107 static final Selector compareTo = | 115 static final Selector compareTo = |
| 108 new Selector.call(const PublicName("compareTo"), CallStructure.ONE_ARG); | 116 new Selector.call(const PublicName("compareTo"), CallStructure.ONE_ARG); |
| 109 | 117 |
| 110 static final Selector equals = new Selector.binaryOperator('=='); | 118 static final Selector equals = new Selector.binaryOperator('=='); |
| 111 | 119 |
| 112 static final Selector length = new Selector.getter(Names.length); | 120 static final Selector length = new Selector.getter(Names.length); |
| 113 | 121 |
| 114 static final Selector codeUnitAt = | 122 static final Selector codeUnitAt = |
| 115 new Selector.call(const PublicName('codeUnitAt'), CallStructure.ONE_ARG); | 123 new Selector.call(const PublicName('codeUnitAt'), CallStructure.ONE_ARG); |
| 116 | 124 |
| 117 static final Selector index = new Selector.index(); | 125 static final Selector index = new Selector.index(); |
| 118 | 126 |
| 119 static final Selector runtimeType_ = new Selector.getter(Names.runtimeType_); | 127 static final Selector runtimeType_ = new Selector.getter(Names.runtimeType_); |
| 120 | 128 |
| 121 /// List of all the selectors held in static fields. | 129 /// List of all the selectors held in static fields. |
| 122 /// | 130 /// |
| 123 /// These objects are shared between different runs in batch-mode and must | 131 /// These objects are shared between different runs in batch-mode and must |
| 124 /// thus remain in the [Selector.canonicalizedValues] map. | 132 /// thus remain in the [Selector.canonicalizedValues] map. |
| 125 static final List<Selector> ALL = <Selector>[ | 133 static final List<Selector> ALL = <Selector>[ |
| 126 cancel, current, iterator, moveNext, noSuchMethod_, toString_, | 134 cancel, current, iterator, moveNext, noSuchMethod_, noSuchMethodGetter, |
| 127 hashCode_, compareTo, equals, length, codeUnitAt, index, runtimeType_]; | 135 toString_, toStringGetter, hashCode_, compareTo, equals, length, |
| 136 codeUnitAt, index, runtimeType_]; |
| 128 } | 137 } |
| 129 | 138 |
| 130 /// [Uri]s commonly used. | 139 /// [Uri]s commonly used. |
| 131 class Uris { | 140 class Uris { |
| 132 /// The URI for 'dart:async'. | 141 /// The URI for 'dart:async'. |
| 133 static final Uri dart_async = new Uri(scheme: 'dart', path: 'async'); | 142 static final Uri dart_async = new Uri(scheme: 'dart', path: 'async'); |
| 134 | 143 |
| 135 /// The URI for 'dart:core'. | 144 /// The URI for 'dart:core'. |
| 136 static final Uri dart_core = new Uri(scheme: 'dart', path: 'core'); | 145 static final Uri dart_core = new Uri(scheme: 'dart', path: 'core'); |
| 137 | 146 |
| 138 /// The URI for 'dart:html'. | 147 /// The URI for 'dart:html'. |
| 139 static final Uri dart_html = new Uri(scheme: 'dart', path: 'html'); | 148 static final Uri dart_html = new Uri(scheme: 'dart', path: 'html'); |
| 140 | 149 |
| 141 /// The URI for 'dart:mirrors'. | 150 /// The URI for 'dart:mirrors'. |
| 142 static final Uri dart_mirrors = new Uri(scheme: 'dart', path: 'mirrors'); | 151 static final Uri dart_mirrors = new Uri(scheme: 'dart', path: 'mirrors'); |
| 143 | 152 |
| 144 /// The URI for 'dart:_internal'. | 153 /// The URI for 'dart:_internal'. |
| 145 static final Uri dart__internal = new Uri(scheme: 'dart', path: '_internal'); | 154 static final Uri dart__internal = new Uri(scheme: 'dart', path: '_internal'); |
| 146 | 155 |
| 147 /// The URI for 'dart:_native_typed_data'. | 156 /// The URI for 'dart:_native_typed_data'. |
| 148 static final Uri dart__native_typed_data = | 157 static final Uri dart__native_typed_data = |
| 149 new Uri(scheme: 'dart', path: '_native_typed_data'); | 158 new Uri(scheme: 'dart', path: '_native_typed_data'); |
| 150 } | 159 } |
| OLD | NEW |