Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/shared/embedded_names.dart

Issue 1198293002: dart2js: Use an abstract Name class for names in the generated JavaScript ast. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix tests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Contains the names of globals that are embedded into the output by the 5 /// Contains the names of globals that are embedded into the output by the
6 /// compiler. 6 /// compiler.
7 /// 7 ///
8 /// Variables embedded this way should be access with `JS_EMBEDDED_GLOBAL` from 8 /// Variables embedded this way should be access with `JS_EMBEDDED_GLOBAL` from
9 /// the `_foreign_helper` library. 9 /// the `_foreign_helper` library.
10 /// 10 ///
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG, 110 FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG,
111 /// Name used to tag optional parameters in function type representations 111 /// Name used to tag optional parameters in function type representations
112 /// in JavaScript. 112 /// in JavaScript.
113 FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG, 113 FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG,
114 /// Name used to tag named parameters in function type representations in 114 /// Name used to tag named parameters in function type representations in
115 /// JavaScript. 115 /// JavaScript.
116 FUNCTION_TYPE_NAMED_PARAMETERS_TAG, 116 FUNCTION_TYPE_NAMED_PARAMETERS_TAG,
117 /// Field name used for determining if an object or its interceptor has 117 /// Field name used for determining if an object or its interceptor has
118 /// JavaScript indexing behavior. 118 /// JavaScript indexing behavior.
119 IS_INDEXABLE_FIELD_NAME, 119 IS_INDEXABLE_FIELD_NAME,
120 /// String representation of the type of the null class.
121 NULL_CLASS_TYPE_NAME,
122 /// String representation of the type of the object class.
123 OBJECT_CLASS_TYPE_NAME,
124 /// String representation of the type of the function class.
125 FUNCTION_CLASS_TYPE_NAME,
120 } 126 }
121 127
122 enum JsBuiltin { 128 enum JsBuiltin {
123 /// Returns the JavaScript constructor function for Dart's Object class. 129 /// Returns the JavaScript constructor function for Dart's Object class.
124 /// This can be used for type tests, as in 130 /// This can be used for type tests, as in
125 /// 131 ///
126 /// var constructor = JS_BUILTIN('', JsBuiltin.dartObjectContructor); 132 /// var constructor = JS_BUILTIN('', JsBuiltin.dartObjectContructor);
127 /// if (JS('bool', '# instanceof #', obj, constructor)) 133 /// if (JS('bool', '# instanceof #', obj, constructor))
128 /// ... 134 /// ...
129 dartObjectConstructor, 135 dartObjectConstructor,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 /// 171 ///
166 /// The argument `other` is the name of the potential supertype. It is 172 /// The argument `other` is the name of the potential supertype. It is
167 /// computed by `runtimeTypeToString`; 173 /// computed by `runtimeTypeToString`;
168 /// 174 ///
169 /// *The `other` name must be passed in before the `type`.* 175 /// *The `other` name must be passed in before the `type`.*
170 /// 176 ///
171 /// JS_BUILTIN('returns:bool;effects:none;depends:none', 177 /// JS_BUILTIN('returns:bool;effects:none;depends:none',
172 /// JsBuiltin.isSubtype, other, type); 178 /// JsBuiltin.isSubtype, other, type);
173 isSubtype, 179 isSubtype,
174 180
175 /// Returns true if the given type is _the_ `Function` type. 181 /// Returns true if the given type equals the type given as second
176 /// That is, it returns true if the given [type] is exactly the `Function` 182 /// argument. Use the JS_GET_NAME helpers to get the type representation
177 /// type rti-encoding. 183 /// for various Dart classes.
178 /// 184 ///
179 /// JS_BUILTIN('returns:bool;effects:none;depends:none', 185 /// JS_BUILTIN('returns:bool;effects:none;depends:none',
180 /// JsBuiltin.isFunctionTypeLiteral, type); 186 /// JsBuiltin.isFunctionTypeLiteral, type, name);
181 isFunctionTypeRti, 187 isGivenTypeRti,
182
183 /// Returns whether the given type is _the_ null-type..
184 ///
185 /// JS_BUILTIN('returns:bool;effects:none;depends:none',
186 /// JsBuiltin.isNullType, type);
187 isNullTypeRti,
188
189 /// Returns whether the given type is _the_ Dart Object type.
190 ///
191 /// JS_BUILTIN('returns:bool;effects:none;depends:none',
192 /// JsBuiltin.isDartObjectType, type);
193 isDartObjectTypeRti,
194 188
195 /// Returns the metadata of the given [index]. 189 /// Returns the metadata of the given [index].
196 /// 190 ///
197 /// JS_BUILTIN('returns:var;effects:none;depends:none', 191 /// JS_BUILTIN('returns:var;effects:none;depends:none',
198 /// JsBuiltin.getMetadata, index); 192 /// JsBuiltin.getMetadata, index);
199 getMetadata, 193 getMetadata,
200 194
201 /// Returns the type of the given [index]. 195 /// Returns the type of the given [index].
202 /// 196 ///
203 /// JS_BUILTIN('returns:var;effects:none;depends:none', 197 /// JS_BUILTIN('returns:var;effects:none;depends:none',
204 /// JsBuiltin.getType, index); 198 /// JsBuiltin.getType, index);
205 getType, 199 getType,
206 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698