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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/namer.dart

Issue 23978010: Support dynamic as type literal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change dart2dart renamer. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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; 5 part of js_backend;
6 6
7 /** 7 /**
8 * Assigns JavaScript identifiers to Dart variables, class-names and members. 8 * Assigns JavaScript identifiers to Dart variables, class-names and members.
9 */ 9 */
10 class Namer implements ClosureNamer { 10 class Namer implements ClosureNamer {
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 name = '$unminifiedName$level'; 650 name = '$unminifiedName$level';
651 } 651 }
652 name = getMappedInstanceName(name); 652 name = getMappedInstanceName(name);
653 } 653 }
654 bailoutNames[element] = name; 654 bailoutNames[element] = name;
655 return name; 655 return name;
656 } 656 }
657 657
658 /// Returns the runtime name for [element]. The result is not safe as an id. 658 /// Returns the runtime name for [element]. The result is not safe as an id.
659 String getRuntimeTypeName(Element element) { 659 String getRuntimeTypeName(Element element) {
660 if (identical(element, compiler.dynamicClass)) return 'dynamic';
660 JavaScriptBackend backend = compiler.backend; 661 JavaScriptBackend backend = compiler.backend;
661 element = backend.getImplementationClass(element); 662 element = backend.getImplementationClass(element);
662 String name = getPrimitiveInterceptorRuntimeName(element); 663 String name = getPrimitiveInterceptorRuntimeName(element);
663 return name != null ? name : getName(element); 664 return name != null ? name : getName(element);
664 } 665 }
665 666
666 /** 667 /**
667 * Return a string to be used as the runtime name of this class (instead of 668 * Return a string to be used as the runtime name of this class (instead of
668 * the class name) or [null] if the class name should be used. 669 * the class name) or [null] if the class name should be used.
669 */ 670 */
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 if (!first) { 1280 if (!first) {
1280 sb.write('_'); 1281 sb.write('_');
1281 } 1282 }
1282 sb.write('_'); 1283 sb.write('_');
1283 visit(link.head); 1284 visit(link.head);
1284 first = true; 1285 first = true;
1285 } 1286 }
1286 } 1287 }
1287 } 1288 }
1288 } 1289 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698