| 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 import 'dart:_js_embedded_names' show JsGetName; | |
| 8 | |
| 9 /** | 7 /** |
| 10 * Emits a JavaScript code fragment parameterized by arguments. | 8 * Emits a JavaScript code fragment parameterized by arguments. |
| 11 * | 9 * |
| 12 * 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 |
| 13 * with expressions that contain the values of, or evaluate to, the arguments. | 11 * with expressions that contain the values of, or evaluate to, the arguments. |
| 14 * The number of hash marks must match the number or arguments. Although | 12 * The number of hash marks must match the number or arguments. Although |
| 15 * declared with arguments [arg0] through [arg2], the form actually has no limit | 13 * declared with arguments [arg0] through [arg2], the form actually has no limit |
| 16 * on the number of arguments. | 14 * on the number of arguments. |
| 17 * | 15 * |
| 18 * The [typeDescription] argument is interpreted as a description of the | 16 * The [typeDescription] argument is interpreted as a description of the |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 */ | 233 */ |
| 236 String JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG() {} | 234 String JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG() {} |
| 237 | 235 |
| 238 /** | 236 /** |
| 239 * Returns the name used to tag named parameters in function type | 237 * Returns the name used to tag named parameters in function type |
| 240 * representations in JavaScript. | 238 * representations in JavaScript. |
| 241 */ | 239 */ |
| 242 String JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG() {} | 240 String JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG() {} |
| 243 | 241 |
| 244 /// Returns the JS name for [name] from the Namer. | 242 /// Returns the JS name for [name] from the Namer. |
| 245 String JS_GET_NAME(JsGetName name) {} | 243 String JS_GET_NAME(String name) {} |
| 246 | 244 |
| 247 /// Reads an embedded global. | 245 /// Reads an embedded global. |
| 248 /// | 246 /// |
| 249 /// 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. |
| 250 JS_EMBEDDED_GLOBAL(String typeDescription, String name) {} | 248 JS_EMBEDDED_GLOBAL(String typeDescription, String name) {} |
| 251 | 249 |
| 252 /// Returns the state of a flag that is determined by the state of the compiler | 250 /// Returns the state of a flag that is determined by the state of the compiler |
| 253 /// when the program has been analyzed. | 251 /// when the program has been analyzed. |
| 254 bool JS_GET_FLAG(String name) {} | 252 bool JS_GET_FLAG(String name) {} |
| 255 | 253 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 284 } | 282 } |
| 285 | 283 |
| 286 /** | 284 /** |
| 287 * JavaScript string concatenation. Inputs must be Strings. Corresponds to the | 285 * JavaScript string concatenation. Inputs must be Strings. Corresponds to the |
| 288 * HStringConcat SSA instruction and may be constant-folded. | 286 * HStringConcat SSA instruction and may be constant-folded. |
| 289 */ | 287 */ |
| 290 String JS_STRING_CONCAT(String a, String b) { | 288 String JS_STRING_CONCAT(String a, String b) { |
| 291 // This body is unused, only here for type analysis. | 289 // This body is unused, only here for type analysis. |
| 292 return JS('String', '# + #', a, b); | 290 return JS('String', '# + #', a, b); |
| 293 } | 291 } |
| OLD | NEW |