| 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 return operatorIs(helpers.jsIndexingBehaviorInterface); | 636 return operatorIs(helpers.jsIndexingBehaviorInterface); |
| 637 case JsGetName.NULL_CLASS_TYPE_NAME: | 637 case JsGetName.NULL_CLASS_TYPE_NAME: |
| 638 ClassElement nullClass = commonElements.nullClass; | 638 ClassElement nullClass = commonElements.nullClass; |
| 639 return runtimeTypeName(nullClass); | 639 return runtimeTypeName(nullClass); |
| 640 case JsGetName.OBJECT_CLASS_TYPE_NAME: | 640 case JsGetName.OBJECT_CLASS_TYPE_NAME: |
| 641 ClassElement objectClass = commonElements.objectClass; | 641 ClassElement objectClass = commonElements.objectClass; |
| 642 return runtimeTypeName(objectClass); | 642 return runtimeTypeName(objectClass); |
| 643 case JsGetName.FUNCTION_CLASS_TYPE_NAME: | 643 case JsGetName.FUNCTION_CLASS_TYPE_NAME: |
| 644 ClassElement functionClass = commonElements.functionClass; | 644 ClassElement functionClass = commonElements.functionClass; |
| 645 return runtimeTypeName(functionClass); | 645 return runtimeTypeName(functionClass); |
| 646 case JsGetName.VOID_CLASS_TYPE_NAME: |
| 647 ClassElement voidClass = helpers.voidClass; |
| 648 return runtimeTypeName(voidClass); |
| 646 default: | 649 default: |
| 647 reporter.reportErrorMessage(node, MessageKind.GENERIC, | 650 reporter.reportErrorMessage(node, MessageKind.GENERIC, |
| 648 {'text': 'Error: Namer has no name for "$name".'}); | 651 {'text': 'Error: Namer has no name for "$name".'}); |
| 649 return asName('BROKEN'); | 652 return asName('BROKEN'); |
| 650 } | 653 } |
| 651 } | 654 } |
| 652 | 655 |
| 653 /// Return a reference to the given [name]. | 656 /// Return a reference to the given [name]. |
| 654 /// | 657 /// |
| 655 /// This is used to ensure that every use site of a name has a unique node so | 658 /// This is used to ensure that every use site of a name has a unique node so |
| (...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2192 void addSuggestion(String original, String suggestion) { | 2195 void addSuggestion(String original, String suggestion) { |
| 2193 assert(!_suggestedNames.containsKey(original)); | 2196 assert(!_suggestedNames.containsKey(original)); |
| 2194 _suggestedNames[original] = suggestion; | 2197 _suggestedNames[original] = suggestion; |
| 2195 } | 2198 } |
| 2196 | 2199 |
| 2197 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); | 2200 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); |
| 2198 bool isSuggestion(String candidate) { | 2201 bool isSuggestion(String candidate) { |
| 2199 return _suggestedNames.containsValue(candidate); | 2202 return _suggestedNames.containsValue(candidate); |
| 2200 } | 2203 } |
| 2201 } | 2204 } |
| OLD | NEW |