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

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

Issue 2731163002: Split js interop registration into library/class/member elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 9 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.namer; 5 part of js_backend.namer;
6 6
7 class FrequencyBasedNamer extends Namer 7 class FrequencyBasedNamer extends Namer
8 with _MinifiedFieldNamer, _MinifiedOneShotInterceptorNamer 8 with _MinifiedFieldNamer, _MinifiedOneShotInterceptorNamer
9 implements jsAst.TokenFinalizer { 9 implements jsAst.TokenFinalizer {
10 _FieldNamingRegistry fieldRegistry; 10 _FieldNamingRegistry fieldRegistry;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 String proposed = _generateFreshStringForName(proposedName, scope, 57 String proposed = _generateFreshStringForName(proposedName, scope,
58 sanitizeForNatives: sanitizeForNatives, 58 sanitizeForNatives: sanitizeForNatives,
59 sanitizeForAnnotations: sanitizeForAnnotations); 59 sanitizeForAnnotations: sanitizeForAnnotations);
60 60
61 TokenName name = new TokenName(tokenScope, proposed); 61 TokenName name = new TokenName(tokenScope, proposed);
62 tokens.add(name); 62 tokens.add(name);
63 return name; 63 return name;
64 } 64 }
65 65
66 @override 66 @override
67 jsAst.Name instanceFieldPropertyName(Element element) { 67 jsAst.Name instanceFieldPropertyName(FieldElement element) {
68 jsAst.Name proposed = _minifiedInstanceFieldPropertyName(element); 68 jsAst.Name proposed = _minifiedInstanceFieldPropertyName(element);
69 if (proposed != null) { 69 if (proposed != null) {
70 return proposed; 70 return proposed;
71 } 71 }
72 return super.instanceFieldPropertyName(element); 72 return super.instanceFieldPropertyName(element);
73 } 73 }
74 74
75 @override 75 @override
76 void finalizeTokens() { 76 void finalizeTokens() {
77 int compareReferenceCount(TokenName a, TokenName b) { 77 int compareReferenceCount(TokenName a, TokenName b) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 String proposal; 133 String proposal;
134 do { 134 do {
135 proposal = new String.fromCharCodes(_nextName); 135 proposal = new String.fromCharCodes(_nextName);
136 _incrementName(); 136 _incrementName();
137 } while (MinifyNamer._hasBannedPrefix(proposal) || 137 } while (MinifyNamer._hasBannedPrefix(proposal) ||
138 illegalNames.contains(proposal)); 138 illegalNames.contains(proposal));
139 139
140 return proposal; 140 return proposal;
141 } 141 }
142 } 142 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/field_naming_mixin.dart ('k') | pkg/compiler/lib/src/js_backend/js_interop_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698