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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/renamer.dart

Issue 1309743006: Move common URIs to common/names.dart (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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) 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 Comparator get _compareNodes => 7 Comparator get _compareNodes =>
8 compareBy((n) => n.getBeginToken().charOffset); 8 compareBy((n) => n.getBeginToken().charOffset);
9 9
10 abstract class Renamable implements Comparable { 10 abstract class Renamable implements Comparable {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 Elements.isStaticOrTopLevel(entity) || 139 Elements.isStaticOrTopLevel(entity) ||
140 entity is TypeVariableElement); 140 entity is TypeVariableElement);
141 // TODO(smok): We may want to reuse class static field and method names. 141 // TODO(smok): We may want to reuse class static field and method names.
142 if (entity is Element) { 142 if (entity is Element) {
143 LibraryElement library = entity.library; 143 LibraryElement library = entity.library;
144 if (reexportingLibraries.containsKey(entity)) { 144 if (reexportingLibraries.containsKey(entity)) {
145 library = reexportingLibraries[entity]; 145 library = reexportingLibraries[entity];
146 } 146 }
147 if (library.isPlatformLibrary) { 147 if (library.isPlatformLibrary) {
148 // TODO(johnniwinther): Handle prefixes for dart:core. 148 // TODO(johnniwinther): Handle prefixes for dart:core.
149 if (library.canonicalUri == Compiler.DART_CORE) return entity.name; 149 if (library.canonicalUri == Uris.dart_core) return entity.name;
150 if (library.isInternalLibrary) { 150 if (library.isInternalLibrary) {
151 throw new SpannableAssertionFailure(entity, 151 throw new SpannableAssertionFailure(entity,
152 "Internal library $library should never have been imported from " 152 "Internal library $library should never have been imported from "
153 "the code compiled by dart2dart."); 153 "the code compiled by dart2dart.");
154 } 154 }
155 155
156 String prefix = platformImports.putIfAbsent(library, () => null); 156 String prefix = platformImports.putIfAbsent(library, () => null);
157 if (entity.isTopLevel && 157 if (entity.isTopLevel &&
158 fixedDynamicNames.contains(entity.name)) { 158 fixedDynamicNames.contains(entity.name)) {
159 if (prefix == null) { 159 if (prefix == null) {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 MinifyingGenerator(); 366 MinifyingGenerator();
367 367
368 String generate(String originalName, bool isForbidden(String name)) { 368 String generate(String originalName, bool isForbidden(String name)) {
369 String result; 369 String result;
370 do { 370 do {
371 result = generateMiniId(index++); 371 result = generateMiniId(index++);
372 } while (isForbidden(result)); 372 } while (isForbidden(result));
373 return result; 373 return result;
374 } 374 }
375 } 375 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/dart_backend.dart ('k') | pkg/compiler/lib/src/elements/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698