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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 case JsGetName.OPERATOR_AS_PREFIX: | 623 case JsGetName.OPERATOR_AS_PREFIX: |
624 return asName(operatorAsPrefix); | 624 return asName(operatorAsPrefix); |
625 case JsGetName.SIGNATURE_NAME: | 625 case JsGetName.SIGNATURE_NAME: |
626 return asName(operatorSignature); | 626 return asName(operatorSignature); |
627 case JsGetName.RTI_NAME: | 627 case JsGetName.RTI_NAME: |
628 return asName(rtiName); | 628 return asName(rtiName); |
629 case JsGetName.TYPEDEF_TAG: | 629 case JsGetName.TYPEDEF_TAG: |
630 return asName(typedefTag); | 630 return asName(typedefTag); |
631 case JsGetName.FUNCTION_TYPE_TAG: | 631 case JsGetName.FUNCTION_TYPE_TAG: |
632 return asName(functionTypeTag); | 632 return asName(functionTypeTag); |
633 case JsGetName.FUNCTION_TYPE_VOID_RETURN_TAG: | |
634 return asName(functionTypeVoidReturnTag); | |
635 case JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG: | 633 case JsGetName.FUNCTION_TYPE_RETURN_TYPE_TAG: |
636 return asName(functionTypeReturnTypeTag); | 634 return asName(functionTypeReturnTypeTag); |
637 case JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG: | 635 case JsGetName.FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG: |
638 return asName(functionTypeRequiredParametersTag); | 636 return asName(functionTypeRequiredParametersTag); |
639 case JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG: | 637 case JsGetName.FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG: |
640 return asName(functionTypeOptionalParametersTag); | 638 return asName(functionTypeOptionalParametersTag); |
641 case JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG: | 639 case JsGetName.FUNCTION_TYPE_NAMED_PARAMETERS_TAG: |
642 return asName(functionTypeNamedParametersTag); | 640 return asName(functionTypeNamedParametersTag); |
643 case JsGetName.IS_INDEXABLE_FIELD_NAME: | 641 case JsGetName.IS_INDEXABLE_FIELD_NAME: |
644 return operatorIs(helpers.jsIndexingBehaviorInterface); | 642 return operatorIs(helpers.jsIndexingBehaviorInterface); |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 String get operatorIsPrefix => r'$is'; | 1557 String get operatorIsPrefix => r'$is'; |
1560 | 1558 |
1561 String get operatorAsPrefix => r'$as'; | 1559 String get operatorAsPrefix => r'$as'; |
1562 | 1560 |
1563 String get operatorSignature => r'$signature'; | 1561 String get operatorSignature => r'$signature'; |
1564 | 1562 |
1565 String get typedefTag => r'typedef'; | 1563 String get typedefTag => r'typedef'; |
1566 | 1564 |
1567 String get functionTypeTag => r'func'; | 1565 String get functionTypeTag => r'func'; |
1568 | 1566 |
1569 String get functionTypeVoidReturnTag => r'v'; | |
1570 | |
1571 String get functionTypeReturnTypeTag => r'ret'; | 1567 String get functionTypeReturnTypeTag => r'ret'; |
1572 | 1568 |
1573 String get functionTypeRequiredParametersTag => r'args'; | 1569 String get functionTypeRequiredParametersTag => r'args'; |
1574 | 1570 |
1575 String get functionTypeOptionalParametersTag => r'opt'; | 1571 String get functionTypeOptionalParametersTag => r'opt'; |
1576 | 1572 |
1577 String get functionTypeNamedParametersTag => r'named'; | 1573 String get functionTypeNamedParametersTag => r'named'; |
1578 | 1574 |
1579 Map<ResolutionFunctionType, jsAst.Name> functionTypeNameMap = | 1575 Map<ResolutionFunctionType, jsAst.Name> functionTypeNameMap = |
1580 new HashMap<ResolutionFunctionType, jsAst.Name>(); | 1576 new HashMap<ResolutionFunctionType, jsAst.Name>(); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2215 void addSuggestion(String original, String suggestion) { | 2211 void addSuggestion(String original, String suggestion) { |
2216 assert(!_suggestedNames.containsKey(original)); | 2212 assert(!_suggestedNames.containsKey(original)); |
2217 _suggestedNames[original] = suggestion; | 2213 _suggestedNames[original] = suggestion; |
2218 } | 2214 } |
2219 | 2215 |
2220 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); | 2216 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); |
2221 bool isSuggestion(String candidate) { | 2217 bool isSuggestion(String candidate) { |
2222 return _suggestedNames.containsValue(candidate); | 2218 return _suggestedNames.containsValue(candidate); |
2223 } | 2219 } |
2224 } | 2220 } |
OLD | NEW |