Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1568)

Side by Side Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 1913033002: dart2js: Pass type information to constructor rather than add later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698