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

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

Issue 24615003: Add DartType.treatAsRaw to treat List<dynamic> as List in the backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 f(element, map[element]); 83 f(element, map[element]);
84 } 84 }
85 } 85 }
86 86
87 String renameType(DartType type, Function renameElement) { 87 String renameType(DartType type, Function renameElement) {
88 // TODO(smok): Do not rename type if it is in platform library or 88 // TODO(smok): Do not rename type if it is in platform library or
89 // js-helpers. 89 // js-helpers.
90 StringBuffer result = new StringBuffer(renameElement(type.element)); 90 StringBuffer result = new StringBuffer(renameElement(type.element));
91 if (type is InterfaceType) { 91 if (type is InterfaceType) {
92 InterfaceType interfaceType = type; 92 InterfaceType interfaceType = type;
93 if (!interfaceType.isRaw) { 93 if (!interfaceType.treatAsRaw) {
94 result.write('<'); 94 result.write('<');
95 Link<DartType> argumentsLink = interfaceType.typeArguments; 95 Link<DartType> argumentsLink = interfaceType.typeArguments;
96 result.write(renameType(argumentsLink.head, renameElement)); 96 result.write(renameType(argumentsLink.head, renameElement));
97 for (Link<DartType> link = argumentsLink.tail; !link.isEmpty; 97 for (Link<DartType> link = argumentsLink.tail; !link.isEmpty;
98 link = link.tail) { 98 link = link.tail) {
99 result.write(','); 99 result.write(',');
100 result.write(renameType(link.head, renameElement)); 100 result.write(renameType(link.head, renameElement));
101 } 101 }
102 result.write('>'); 102 result.write('>');
103 } 103 }
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 index ~/= firstCharAlphabet.length; 349 index ~/= firstCharAlphabet.length;
350 int length = otherCharsAlphabet.length; 350 int length = otherCharsAlphabet.length;
351 while (index >= length) { 351 while (index >= length) {
352 resultBuilder.write(otherCharsAlphabet[index % length]); 352 resultBuilder.write(otherCharsAlphabet[index % length]);
353 index ~/= length; 353 index ~/= length;
354 } 354 }
355 resultBuilder.write(otherCharsAlphabet[index]); 355 resultBuilder.write(otherCharsAlphabet[index]);
356 return resultBuilder.toString(); 356 return resultBuilder.toString();
357 } 357 }
358 } 358 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698