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

Unified Diff: lib/compiler/implementation/js_backend/namer.dart

Issue 10915104: Move namer into javascript backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/js_backend/namer.dart
diff --git a/lib/compiler/implementation/namer.dart b/lib/compiler/implementation/js_backend/namer.dart
similarity index 88%
rename from lib/compiler/implementation/namer.dart
rename to lib/compiler/implementation/js_backend/namer.dart
index 9f2897df2698a4914bba7a95677308d725776916..50f678f4e7f393aaa9b31330e3f011746b7b8344 100644
--- a/lib/compiler/implementation/namer.dart
+++ b/lib/compiler/implementation/js_backend/namer.dart
@@ -61,38 +61,6 @@ class Namer {
return 'c\$${target.nestingLevel}';
}
- /** Returns a non-unique name for the given closure element. */
- String closureName(Element element) {
- List<String> parts = <String>[];
- SourceString ownName = element.name;
- if (ownName == null || ownName.stringValue == "") {
- parts.add("anon");
- } else {
- parts.add(ownName.slowToString());
- }
- for (Element enclosingElement = element.enclosingElement;
- enclosingElement != null &&
- (enclosingElement.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY
- || enclosingElement.kind === ElementKind.CLASS
- || enclosingElement.kind === ElementKind.FUNCTION
- || enclosingElement.kind === ElementKind.GETTER
- || enclosingElement.kind === ElementKind.SETTER);
- enclosingElement = enclosingElement.enclosingElement) {
- SourceString surroundingName = enclosingElement.name;
- if (surroundingName != null) {
- String surroundingNameString = surroundingName.slowToString();
- if (surroundingNameString != "") parts.add(surroundingNameString);
- }
- }
- // Invert the parts.
- for (int i = 0, j = parts.length - 1; i < j; i++, j--) {
- var tmp = parts[i];
- parts[i] = parts[j];
- parts[j] = tmp;
- }
- return safeName(Strings.join(parts, "_"));
- }
-
String privateName(LibraryElement lib, SourceString name) {
if (name.isPrivate()) {
String nameString = name.slowToString();

Powered by Google App Engine
This is Rietveld 408576698