| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 final String methodsWithOptionalArgumentsField = | 339 final String methodsWithOptionalArgumentsField = |
| 340 r'$methodsWithOptionalArguments'; | 340 r'$methodsWithOptionalArguments'; |
| 341 final String deferredAction = r'$deferredAction'; | 341 final String deferredAction = r'$deferredAction'; |
| 342 | 342 |
| 343 final String classDescriptorProperty = r'^'; | 343 final String classDescriptorProperty = r'^'; |
| 344 final String requiredParameterField = r'$requiredArgCount'; | 344 final String requiredParameterField = r'$requiredArgCount'; |
| 345 | 345 |
| 346 /// The non-minifying namer's [callPrefix] with a dollar after it. | 346 /// The non-minifying namer's [callPrefix] with a dollar after it. |
| 347 static const String _callPrefixDollar = r'call$'; | 347 static const String _callPrefixDollar = r'call$'; |
| 348 | 348 |
| 349 static final jsAst.Name _literalSuper = new StringBackedName("super"); | |
| 350 static final jsAst.Name _literalDollar = new StringBackedName(r'$'); | 349 static final jsAst.Name _literalDollar = new StringBackedName(r'$'); |
| 351 static final jsAst.Name _literalUnderscore = new StringBackedName('_'); | 350 static final jsAst.Name _literalUnderscore = new StringBackedName('_'); |
| 352 static final jsAst.Name literalPlus = new StringBackedName('+'); | 351 static final jsAst.Name literalPlus = new StringBackedName('+'); |
| 353 static final jsAst.Name _literalDynamic = new StringBackedName("dynamic"); | 352 static final jsAst.Name _literalDynamic = new StringBackedName("dynamic"); |
| 354 | 353 |
| 355 jsAst.Name _literalAsyncPrefix; | 354 jsAst.Name _literalAsyncPrefix; |
| 356 jsAst.Name _literalGetterPrefix; | 355 jsAst.Name _literalGetterPrefix; |
| 357 jsAst.Name _literalSetterPrefix; | 356 jsAst.Name _literalSetterPrefix; |
| 358 jsAst.Name _literalLazyGetterPrefix; | 357 jsAst.Name _literalLazyGetterPrefix; |
| 359 | 358 |
| (...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 void addSuggestion(String original, String suggestion) { | 2042 void addSuggestion(String original, String suggestion) { |
| 2044 assert(!_suggestedNames.containsKey(original)); | 2043 assert(!_suggestedNames.containsKey(original)); |
| 2045 _suggestedNames[original] = suggestion; | 2044 _suggestedNames[original] = suggestion; |
| 2046 } | 2045 } |
| 2047 | 2046 |
| 2048 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); | 2047 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); |
| 2049 bool isSuggestion(String candidate) { | 2048 bool isSuggestion(String candidate) { |
| 2050 return _suggestedNames.containsValue(candidate); | 2049 return _suggestedNames.containsValue(candidate); |
| 2051 } | 2050 } |
| 2052 } | 2051 } |
| OLD | NEW |