| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 final String callPrefix = 'call'; | 325 final String callPrefix = 'call'; |
| 326 final String callCatchAllName = r'call*'; | 326 final String callCatchAllName = r'call*'; |
| 327 final String callNameField = r'$callName'; | 327 final String callNameField = r'$callName'; |
| 328 final String reflectableField = r'$reflectable'; | 328 final String reflectableField = r'$reflectable'; |
| 329 final String reflectionInfoField = r'$reflectionInfo'; | 329 final String reflectionInfoField = r'$reflectionInfo'; |
| 330 final String reflectionNameField = r'$reflectionName'; | 330 final String reflectionNameField = r'$reflectionName'; |
| 331 final String metadataIndexField = r'$metadataIndex'; | 331 final String metadataIndexField = r'$metadataIndex'; |
| 332 final String defaultValuesField = r'$defaultValues'; | 332 final String defaultValuesField = r'$defaultValues'; |
| 333 final String methodsWithOptionalArgumentsField = | 333 final String methodsWithOptionalArgumentsField = |
| 334 r'$methodsWithOptionalArguments'; | 334 r'$methodsWithOptionalArguments'; |
| 335 final String deferredAction = r'$deferredAction'; |
| 335 | 336 |
| 336 final String classDescriptorProperty = r'^'; | 337 final String classDescriptorProperty = r'^'; |
| 337 final String requiredParameterField = r'$requiredArgCount'; | 338 final String requiredParameterField = r'$requiredArgCount'; |
| 338 | 339 |
| 339 /// The non-minifying namer's [callPrefix] with a dollar after it. | 340 /// The non-minifying namer's [callPrefix] with a dollar after it. |
| 340 static const String _callPrefixDollar = r'call$'; | 341 static const String _callPrefixDollar = r'call$'; |
| 341 | 342 |
| 342 // Name of property in a class description for the native dispatch metadata. | 343 // Name of property in a class description for the native dispatch metadata. |
| 343 final String nativeSpecProperty = '%'; | 344 final String nativeSpecProperty = '%'; |
| 344 | 345 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 case JsGetName.SETTER_PREFIX: return setterPrefix; | 419 case JsGetName.SETTER_PREFIX: return setterPrefix; |
| 419 case JsGetName.CALL_PREFIX: return callPrefix; | 420 case JsGetName.CALL_PREFIX: return callPrefix; |
| 420 case JsGetName.CALL_CATCH_ALL: return callCatchAllName; | 421 case JsGetName.CALL_CATCH_ALL: return callCatchAllName; |
| 421 case JsGetName.REFLECTABLE: return reflectableField; | 422 case JsGetName.REFLECTABLE: return reflectableField; |
| 422 case JsGetName.CLASS_DESCRIPTOR_PROPERTY: | 423 case JsGetName.CLASS_DESCRIPTOR_PROPERTY: |
| 423 return classDescriptorProperty; | 424 return classDescriptorProperty; |
| 424 case JsGetName.REQUIRED_PARAMETER_PROPERTY: | 425 case JsGetName.REQUIRED_PARAMETER_PROPERTY: |
| 425 return requiredParameterField; | 426 return requiredParameterField; |
| 426 case JsGetName.DEFAULT_VALUES_PROPERTY: return defaultValuesField; | 427 case JsGetName.DEFAULT_VALUES_PROPERTY: return defaultValuesField; |
| 427 case JsGetName.CALL_NAME_PROPERTY: return callNameField; | 428 case JsGetName.CALL_NAME_PROPERTY: return callNameField; |
| 429 case JsGetName.DEFERRED_ACTION_PROPERTY: return deferredAction; |
| 428 default: | 430 default: |
| 429 compiler.reportError( | 431 compiler.reportError( |
| 430 node, MessageKind.GENERIC, | 432 node, MessageKind.GENERIC, |
| 431 {'text': 'Error: Namer has no name for "$name".'}); | 433 {'text': 'Error: Namer has no name for "$name".'}); |
| 432 return 'BROKEN'; | 434 return 'BROKEN'; |
| 433 } | 435 } |
| 434 } | 436 } |
| 435 | 437 |
| 436 /// Disambiguated name for [constant]. | 438 /// Disambiguated name for [constant]. |
| 437 /// | 439 /// |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 if (!first) { | 1769 if (!first) { |
| 1768 sb.write('_'); | 1770 sb.write('_'); |
| 1769 } | 1771 } |
| 1770 sb.write('_'); | 1772 sb.write('_'); |
| 1771 visit(parameter); | 1773 visit(parameter); |
| 1772 first = true; | 1774 first = true; |
| 1773 } | 1775 } |
| 1774 } | 1776 } |
| 1775 } | 1777 } |
| 1776 } | 1778 } |
| OLD | NEW |