OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /// Library containing identifier, names, and selectors commonly used through |
| 6 /// the compiler. |
| 7 library dart2js.common.names; |
| 8 |
| 9 import '../elements/elements.dart' show |
| 10 Name, |
| 11 PublicName; |
| 12 import '../universe/universe.dart' show |
| 13 Selector; |
| 14 |
| 15 /// [String]s commonly used. |
| 16 class Identifiers { |
| 17 /// The name of the call operator. |
| 18 static const String call = 'call'; |
| 19 |
| 20 /// The name of the from environment constructors on 'int', 'bool' and |
| 21 /// 'String'. |
| 22 static const String fromEnvironment = 'fromEnvironment'; |
| 23 |
| 24 /// The name of the main method. |
| 25 static const String main = 'main'; |
| 26 |
| 27 /// The name of the no such method handler on 'Object'. |
| 28 static const String noSuchMethod_ = 'noSuchMethod'; |
| 29 |
| 30 /// The name of the runtime type property on 'Object'. |
| 31 static const String runtimeType_ = 'runtimeType'; |
| 32 } |
| 33 |
| 34 /// [Name]s commonly used. |
| 35 class Names { |
| 36 /// The name of the call operator. |
| 37 static const Name call = const PublicName(Identifiers.call); |
| 38 |
| 39 /// The name of the current element property used on iterators in for-each |
| 40 /// loops. |
| 41 static const Name current = const PublicName('current'); |
| 42 |
| 43 /// The name of the dynamic type. |
| 44 static const Name dynamic_ = const PublicName('dynamic'); |
| 45 |
| 46 /// The name of the iterator property used in for-each loops. |
| 47 static const Name iterator = const PublicName('iterator'); |
| 48 |
| 49 /// The name of the move next method used on iterators in for-each loops. |
| 50 static const Name moveNext = const PublicName('moveNext'); |
| 51 |
| 52 /// The name of the no such method handler on 'Object'. |
| 53 static const Name noSuchMethod_ = const PublicName(Identifiers.noSuchMethod_); |
| 54 |
| 55 /// The name of the to-string method on 'Object'. |
| 56 static const Name toString_ = const PublicName('toString'); |
| 57 } |
| 58 |
| 59 /// [Selector]s commonly used. |
| 60 class Selectors { |
| 61 /// The selector for calling the cancel method on 'StreamIterator'. |
| 62 static final Selector cancel = |
| 63 new Selector.call(const PublicName('cancel'), 0); |
| 64 |
| 65 /// The selector for getting the current element property used in for-each |
| 66 /// loops. |
| 67 static final Selector current = new Selector.getter(Names.current); |
| 68 |
| 69 /// The selector for getting the iterator property used in for-each loops. |
| 70 static final Selector iterator = new Selector.getter(Names.iterator); |
| 71 |
| 72 /// The selector for calling the move next method used in for-each loops. |
| 73 static final Selector moveNext = new Selector.call(Names.moveNext, 0); |
| 74 |
| 75 /// The selector for calling the no such method handler on 'Object'. |
| 76 static final Selector noSuchMethod_ = |
| 77 new Selector.call(Names.noSuchMethod_, 1); |
| 78 |
| 79 /// The selector for calling the to-string method on 'Object'. |
| 80 static final Selector toString_ = new Selector.call(Names.toString_, 0); |
| 81 } |
OLD | NEW |