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