| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Assigns JavaScript identifiers to Dart variables, class-names and members. | 8 * Assigns JavaScript identifiers to Dart variables, class-names and members. |
| 9 * | 9 * |
| 10 * Names are generated through three stages: | 10 * Names are generated through three stages: |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 String get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME; | 410 String get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME; |
| 411 bool get shouldMinify => false; | 411 bool get shouldMinify => false; |
| 412 | 412 |
| 413 /// Returns the string that is to be used as the result of a call to | 413 /// Returns the string that is to be used as the result of a call to |
| 414 /// [JS_GET_NAME] at [node] with argument [name]. | 414 /// [JS_GET_NAME] at [node] with argument [name]. |
| 415 String getNameForJsGetName(Node node, JsGetName name) { | 415 String getNameForJsGetName(Node node, JsGetName name) { |
| 416 switch (name) { | 416 switch (name) { |
| 417 case JsGetName.GETTER_PREFIX: return getterPrefix; | 417 case JsGetName.GETTER_PREFIX: return getterPrefix; |
| 418 case JsGetName.SETTER_PREFIX: return setterPrefix; | 418 case JsGetName.SETTER_PREFIX: return setterPrefix; |
| 419 case JsGetName.CALL_PREFIX: return callPrefix; | 419 case JsGetName.CALL_PREFIX: return callPrefix; |
| 420 case JsGetName.CALL_PREFIX0: return '${callPrefix}\$0'; |
| 421 case JsGetName.CALL_PREFIX1: return '${callPrefix}\$1'; |
| 422 case JsGetName.CALL_PREFIX2: return '${callPrefix}\$2'; |
| 423 case JsGetName.CALL_PREFIX3: return '${callPrefix}\$3'; |
| 420 case JsGetName.CALL_CATCH_ALL: return callCatchAllName; | 424 case JsGetName.CALL_CATCH_ALL: return callCatchAllName; |
| 421 case JsGetName.REFLECTABLE: return reflectableField; | 425 case JsGetName.REFLECTABLE: return reflectableField; |
| 422 case JsGetName.CLASS_DESCRIPTOR_PROPERTY: | 426 case JsGetName.CLASS_DESCRIPTOR_PROPERTY: |
| 423 return classDescriptorProperty; | 427 return classDescriptorProperty; |
| 424 case JsGetName.REQUIRED_PARAMETER_PROPERTY: | 428 case JsGetName.REQUIRED_PARAMETER_PROPERTY: |
| 425 return requiredParameterField; | 429 return requiredParameterField; |
| 426 case JsGetName.DEFAULT_VALUES_PROPERTY: return defaultValuesField; | 430 case JsGetName.DEFAULT_VALUES_PROPERTY: return defaultValuesField; |
| 427 case JsGetName.CALL_NAME_PROPERTY: return callNameField; | 431 case JsGetName.CALL_NAME_PROPERTY: return callNameField; |
| 428 default: | 432 default: |
| 429 compiler.reportError( | 433 compiler.reportError( |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 if (!first) { | 1771 if (!first) { |
| 1768 sb.write('_'); | 1772 sb.write('_'); |
| 1769 } | 1773 } |
| 1770 sb.write('_'); | 1774 sb.write('_'); |
| 1771 visit(parameter); | 1775 visit(parameter); |
| 1772 first = true; | 1776 first = true; |
| 1773 } | 1777 } |
| 1774 } | 1778 } |
| 1775 } | 1779 } |
| 1776 } | 1780 } |
| OLD | NEW |