OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 _foreign_helper; | 5 library _foreign_helper; |
6 | 6 |
7 /** | 7 /** |
8 * Emits a JavaScript code fragment parameterized by arguments. | 8 * Emits a JavaScript code fragment parameterized by arguments. |
9 * | 9 * |
10 * Hash characters `#` in the [codeTemplate] are replaced in left-to-right order | 10 * Hash characters `#` in the [codeTemplate] are replaced in left-to-right order |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 String JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG() {} | 240 String JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG() {} |
241 | 241 |
242 /// Returns the JS name for [name] from the Namer. | 242 /// Returns the JS name for [name] from the Namer. |
243 String JS_GET_NAME(String name) {} | 243 String JS_GET_NAME(String name) {} |
244 | 244 |
245 /// Reads an embedded global. | 245 /// Reads an embedded global. |
246 /// | 246 /// |
247 /// The [name] should be a constant defined in the `_embedded_names` library. | 247 /// The [name] should be a constant defined in the `_embedded_names` library. |
248 JS_EMBEDDED_GLOBAL(String typeDescription, String name) {} | 248 JS_EMBEDDED_GLOBAL(String typeDescription, String name) {} |
249 | 249 |
250 /// Instructs the compiler to execute the [macroName] action at the call-site. | |
251 /// | |
252 /// The [macroName] should be a constant defined in the `_embedded_names` | |
253 /// library. | |
254 // Add additional optional arguments if needed. The method is treated internally | |
255 // as a variable argument method. | |
256 JS_COMPILER_MACRO(String typeDescription, String macroName, | |
herhut
2015/02/26 08:50:28
I would prefer the macros to be typed instead of t
| |
257 [arg0, arg1, arg2, arg3, arg4, arg5, arg6, | |
258 arg7, arg8, arg9, arg10, arg11]) {} | |
259 | |
250 /// Returns the state of a flag that is determined by the state of the compiler | 260 /// Returns the state of a flag that is determined by the state of the compiler |
251 /// when the program has been analyzed. | 261 /// when the program has been analyzed. |
252 bool JS_GET_FLAG(String name) {} | 262 bool JS_GET_FLAG(String name) {} |
253 | 263 |
254 /** | 264 /** |
255 * Pretend [code] is executed. Generates no executable code. This is used to | 265 * Pretend [code] is executed. Generates no executable code. This is used to |
256 * model effects at some other point in external code. For example, the | 266 * model effects at some other point in external code. For example, the |
257 * following models an assignment to foo with an unknown value. | 267 * following models an assignment to foo with an unknown value. |
258 * | 268 * |
259 * var foo; | 269 * var foo; |
(...skipping 22 matching lines...) Expand all Loading... | |
282 } | 292 } |
283 | 293 |
284 /** | 294 /** |
285 * JavaScript string concatenation. Inputs must be Strings. Corresponds to the | 295 * JavaScript string concatenation. Inputs must be Strings. Corresponds to the |
286 * HStringConcat SSA instruction and may be constant-folded. | 296 * HStringConcat SSA instruction and may be constant-folded. |
287 */ | 297 */ |
288 String JS_STRING_CONCAT(String a, String b) { | 298 String JS_STRING_CONCAT(String a, String b) { |
289 // This body is unused, only here for type analysis. | 299 // This body is unused, only here for type analysis. |
290 return JS('String', '# + #', a, b); | 300 return JS('String', '# + #', a, b); |
291 } | 301 } |
OLD | NEW |