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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 /// Maps proposed names to *suggested* disambiguated names. | 384 /// Maps proposed names to *suggested* disambiguated names. |
385 /// | 385 /// |
386 /// Suggested names are hints to the [MinifyNamer], suggesting that a specific | 386 /// Suggested names are hints to the [MinifyNamer], suggesting that a specific |
387 /// names be given to the first item with the given proposed name. | 387 /// names be given to the first item with the given proposed name. |
388 /// | 388 /// |
389 /// This is currently used in [MinifyNamer] to assign very short minified | 389 /// This is currently used in [MinifyNamer] to assign very short minified |
390 /// names to things that tend to be used very often. | 390 /// names to things that tend to be used very often. |
391 final Map<String, String> suggestedGlobalNames = <String, String>{}; | 391 final Map<String, String> suggestedGlobalNames = <String, String>{}; |
392 final Map<String, String> suggestedInstanceNames = <String, String>{}; | 392 final Map<String, String> suggestedInstanceNames = <String, String>{}; |
393 | 393 |
394 // All alphanumeric characters. | |
395 static const String _alphaNumeric = | |
396 'abcdefghijklmnopqrstuvwxyzABZDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; | |
397 | |
398 Namer(Compiler compiler) | 394 Namer(Compiler compiler) |
399 : compiler = compiler, | 395 : compiler = compiler, |
400 constantHasher = new ConstantCanonicalHasher(compiler), | 396 constantHasher = new ConstantCanonicalHasher(compiler), |
401 functionTypeNamer = new FunctionTypeNamer(compiler); | 397 functionTypeNamer = new FunctionTypeNamer(compiler); |
402 | 398 |
403 JavaScriptBackend get backend => compiler.backend; | 399 JavaScriptBackend get backend => compiler.backend; |
404 | 400 |
405 String get deferredTypesName => 'deferredTypes'; | 401 String get deferredTypesName => 'deferredTypes'; |
406 String get isolateName => 'Isolate'; | 402 String get isolateName => 'Isolate'; |
407 String get isolatePropertiesName => r'$isolateProperties'; | 403 String get isolatePropertiesName => r'$isolateProperties'; |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 if (!first) { | 1791 if (!first) { |
1796 sb.write('_'); | 1792 sb.write('_'); |
1797 } | 1793 } |
1798 sb.write('_'); | 1794 sb.write('_'); |
1799 visit(parameter); | 1795 visit(parameter); |
1800 first = true; | 1796 first = true; |
1801 } | 1797 } |
1802 } | 1798 } |
1803 } | 1799 } |
1804 } | 1800 } |
OLD | NEW |