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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/renamer.dart

Issue 12045024: Fix map literals from change 17410 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « pkg/oauth2/lib/src/utils.dart ('k') | sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart_backend; 5 part of dart_backend;
6 6
7 Function get _compareNodes => 7 Function get _compareNodes =>
8 compareBy((n) => n.getBeginToken().charOffset); 8 compareBy((n) => n.getBeginToken().charOffset);
9 9
10 typedef String _Renamer(Renamable renamable); 10 typedef String _Renamer(Renamable renamable);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 final prefix = 148 final prefix =
149 imports.putIfAbsent(library, () => generateUniqueName('p')); 149 imports.putIfAbsent(library, () => generateUniqueName('p'));
150 return '$prefix.$originalName'; 150 return '$prefix.$originalName';
151 } 151 }
152 152
153 return rename(library, originalName); 153 return rename(library, originalName);
154 }; 154 };
155 155
156 Function makeRenamer(generateUniqueName) => 156 Function makeRenamer(generateUniqueName) =>
157 (library, originalName) => 157 (library, originalName) =>
158 renamed.putIfAbsent(library, () => <String, String>{}) 158 renamed.putIfAbsent(library, () => {})
159 .putIfAbsent(originalName, 159 .putIfAbsent(originalName,
160 () => generateUniqueName(originalName)); 160 () => generateUniqueName(originalName));
161 161
162 // Renamer function that takes library and original name and returns a new 162 // Renamer function that takes library and original name and returns a new
163 // name for given identifier. 163 // name for given identifier.
164 Function rename; 164 Function rename;
165 Function renameElement; 165 Function renameElement;
166 // A function that takes original identifier name and generates a new unique 166 // A function that takes original identifier name and generates a new unique
167 // identifier. 167 // identifier.
168 Function generateUniqueName; 168 Function generateUniqueName;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 index ~/= firstCharAlphabet.length; 350 index ~/= firstCharAlphabet.length;
351 int length = otherCharsAlphabet.length; 351 int length = otherCharsAlphabet.length;
352 while (index >= length) { 352 while (index >= length) {
353 resultBuilder.add(otherCharsAlphabet[index % length]); 353 resultBuilder.add(otherCharsAlphabet[index % length]);
354 index ~/= length; 354 index ~/= length;
355 } 355 }
356 resultBuilder.add(otherCharsAlphabet[index]); 356 resultBuilder.add(otherCharsAlphabet[index]);
357 return resultBuilder.toString(); 357 return resultBuilder.toString();
358 } 358 }
359 } 359 }
OLDNEW
« no previous file with comments | « pkg/oauth2/lib/src/utils.dart ('k') | sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698