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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 jsAst.Name _literalAsyncPrefix; | 385 jsAst.Name _literalAsyncPrefix; |
386 jsAst.Name _literalGetterPrefix; | 386 jsAst.Name _literalGetterPrefix; |
387 jsAst.Name _literalSetterPrefix; | 387 jsAst.Name _literalSetterPrefix; |
388 jsAst.Name _literalLazyGetterPrefix; | 388 jsAst.Name _literalLazyGetterPrefix; |
389 | 389 |
390 jsAst.Name _staticsPropertyName; | 390 jsAst.Name _staticsPropertyName; |
391 | 391 |
392 jsAst.Name get staticsPropertyName => | 392 jsAst.Name get staticsPropertyName => |
393 _staticsPropertyName ??= new StringBackedName('static'); | 393 _staticsPropertyName ??= new StringBackedName('static'); |
394 | 394 |
| 395 jsAst.Name _rtiFieldName; |
| 396 jsAst.Name get rtiFieldName => _rtiFieldName ??= new StringBackedName(r'$ti'); |
| 397 |
395 // Name of property in a class description for the native dispatch metadata. | 398 // Name of property in a class description for the native dispatch metadata. |
396 final String nativeSpecProperty = '%'; | 399 final String nativeSpecProperty = '%'; |
397 | 400 |
398 static final RegExp IDENTIFIER = new RegExp(r'^[A-Za-z_$][A-Za-z0-9_$]*$'); | 401 static final RegExp IDENTIFIER = new RegExp(r'^[A-Za-z_$][A-Za-z0-9_$]*$'); |
399 static final RegExp NON_IDENTIFIER_CHAR = new RegExp(r'[^A-Za-z_0-9$]'); | 402 static final RegExp NON_IDENTIFIER_CHAR = new RegExp(r'[^A-Za-z_0-9$]'); |
400 | 403 |
401 final Compiler compiler; | 404 final Compiler compiler; |
402 | 405 |
403 /// Used disambiguated names in the global namespace, issued by | 406 /// Used disambiguated names in the global namespace, issued by |
404 /// [_disambiguateGlobal], and [_disambiguateInternalGlobal]. | 407 /// [_disambiguateGlobal], and [_disambiguateInternalGlobal]. |
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 void addSuggestion(String original, String suggestion) { | 2100 void addSuggestion(String original, String suggestion) { |
2098 assert(!_suggestedNames.containsKey(original)); | 2101 assert(!_suggestedNames.containsKey(original)); |
2099 _suggestedNames[original] = suggestion; | 2102 _suggestedNames[original] = suggestion; |
2100 } | 2103 } |
2101 | 2104 |
2102 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); | 2105 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); |
2103 bool isSuggestion(String candidate) { | 2106 bool isSuggestion(String candidate) { |
2104 return _suggestedNames.containsValue(candidate); | 2107 return _suggestedNames.containsValue(candidate); |
2105 } | 2108 } |
2106 } | 2109 } |
OLD | NEW |