| 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 library js_backend.namer; | 5 library js_backend.namer; |
| 6 | 6 |
| 7 import 'dart:collection' show HashMap; | 7 import 'dart:collection' show HashMap; |
| 8 | 8 |
| 9 import 'package:js_runtime/shared/embedded_names.dart' show JsGetName; | 9 import 'package:js_runtime/shared/embedded_names.dart' show JsGetName; |
| 10 | 10 |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 case JsGetName.OPERATOR_AS_PREFIX: | 629 case JsGetName.OPERATOR_AS_PREFIX: |
| 630 return asName(operatorAsPrefix); | 630 return asName(operatorAsPrefix); |
| 631 case JsGetName.SIGNATURE_NAME: | 631 case JsGetName.SIGNATURE_NAME: |
| 632 return asName(operatorSignature); | 632 return asName(operatorSignature); |
| 633 case JsGetName.RTI_NAME: | 633 case JsGetName.RTI_NAME: |
| 634 return asName(rtiName); | 634 return asName(rtiName); |
| 635 case JsGetName.TYPEDEF_TAG: | 635 case JsGetName.TYPEDEF_TAG: |
| 636 return asName(typedefTag); | 636 return asName(typedefTag); |
| 637 case JsGetName.FUNCTION_TYPE_TAG: | 637 case JsGetName.FUNCTION_TYPE_TAG: |
| 638 return asName(functionTypeTag); | 638 return asName(functionTypeTag); |
| 639 case JsGetName.FUNCTION_TYPE_VOID_RETURN_TAG: | |
| 640 return asName(functionTypeVoidReturnTag); | |
| 641 case JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG: | 639 case JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG: |
| 642 return asName(functionTypeReturnTypeTag); | 640 return asName(functionTypeReturnTypeTag); |
| 643 case JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG: | 641 case JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG: |
| 644 return asName(functionTypeRequiredParametersTag); | 642 return asName(functionTypeRequiredParametersTag); |
| 645 case JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG: | 643 case JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG: |
| 646 return asName(functionTypeOptionalParametersTag); | 644 return asName(functionTypeOptionalParametersTag); |
| 647 case JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG: | 645 case JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG: |
| 648 return asName(functionTypeNamedParametersTag); | 646 return asName(functionTypeNamedParametersTag); |
| 649 case JsGetName.IS_INDEXABLE_FIELD_NAME: | 647 case JsGetName.IS_INDEXABLE_FIELD_NAME: |
| 650 return operatorIs(_commonElements.jsIndexingBehaviorInterface); | 648 return operatorIs(_commonElements.jsIndexingBehaviorInterface); |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 String get operatorIsPrefix => r'$is'; | 1530 String get operatorIsPrefix => r'$is'; |
| 1533 | 1531 |
| 1534 String get operatorAsPrefix => r'$as'; | 1532 String get operatorAsPrefix => r'$as'; |
| 1535 | 1533 |
| 1536 String get operatorSignature => r'$signature'; | 1534 String get operatorSignature => r'$signature'; |
| 1537 | 1535 |
| 1538 String get typedefTag => r'typedef'; | 1536 String get typedefTag => r'typedef'; |
| 1539 | 1537 |
| 1540 String get functionTypeTag => r'func'; | 1538 String get functionTypeTag => r'func'; |
| 1541 | 1539 |
| 1542 String get functionTypeVoidReturnTag => r'v'; | |
| 1543 | |
| 1544 String get functionTypeReturnTypeTag => r'ret'; | 1540 String get functionTypeReturnTypeTag => r'ret'; |
| 1545 | 1541 |
| 1546 String get functionTypeRequiredParametersTag => r'args'; | 1542 String get functionTypeRequiredParametersTag => r'args'; |
| 1547 | 1543 |
| 1548 String get functionTypeOptionalParametersTag => r'opt'; | 1544 String get functionTypeOptionalParametersTag => r'opt'; |
| 1549 | 1545 |
| 1550 String get functionTypeNamedParametersTag => r'named'; | 1546 String get functionTypeNamedParametersTag => r'named'; |
| 1551 | 1547 |
| 1552 Map<ResolutionFunctionType, jsAst.Name> functionTypeNameMap = | 1548 Map<ResolutionFunctionType, jsAst.Name> functionTypeNameMap = |
| 1553 new HashMap<ResolutionFunctionType, jsAst.Name>(); | 1549 new HashMap<ResolutionFunctionType, jsAst.Name>(); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2186 void addSuggestion(String original, String suggestion) { | 2182 void addSuggestion(String original, String suggestion) { |
| 2187 assert(!_suggestedNames.containsKey(original)); | 2183 assert(!_suggestedNames.containsKey(original)); |
| 2188 _suggestedNames[original] = suggestion; | 2184 _suggestedNames[original] = suggestion; |
| 2189 } | 2185 } |
| 2190 | 2186 |
| 2191 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); | 2187 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); |
| 2192 bool isSuggestion(String candidate) { | 2188 bool isSuggestion(String candidate) { |
| 2193 return _suggestedNames.containsValue(candidate); | 2189 return _suggestedNames.containsValue(candidate); |
| 2194 } | 2190 } |
| 2195 } | 2191 } |
| OLD | NEW |