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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart

Issue 906273002: Revert "dart2js: Refactoring, documentation, and a few bugfixes in Namer class." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.new_js_emitter.model_emitter; 5 library dart2js.new_js_emitter.model_emitter;
6 6
7 import '../../dart2jslib.dart' show Compiler; 7 import '../../dart2jslib.dart' show Compiler;
8 import '../../dart_types.dart' show DartType; 8 import '../../dart_types.dart' show DartType;
9 import '../../elements/elements.dart' show ClassElement; 9 import '../../elements/elements.dart' show ClassElement;
10 import '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 js.Property emitMangledGlobalNames() { 237 js.Property emitMangledGlobalNames() {
238 List<js.Property> names = <js.Property>[]; 238 List<js.Property> names = <js.Property>[];
239 239
240 // We want to keep the original names for the most common core classes when 240 // We want to keep the original names for the most common core classes when
241 // calling toString on them. 241 // calling toString on them.
242 List<ClassElement> nativeClassesNeedingUnmangledName = 242 List<ClassElement> nativeClassesNeedingUnmangledName =
243 [compiler.intClass, compiler.doubleClass, compiler.numClass, 243 [compiler.intClass, compiler.doubleClass, compiler.numClass,
244 compiler.stringClass, compiler.boolClass, compiler.nullClass, 244 compiler.stringClass, compiler.boolClass, compiler.nullClass,
245 compiler.listClass]; 245 compiler.listClass];
246 nativeClassesNeedingUnmangledName.forEach((element) { 246 nativeClassesNeedingUnmangledName.forEach((element) {
247 names.add(new js.Property(js.string(namer.className(element)), 247 names.add(new js.Property(js.string(namer.getNameOfClass(element)),
248 js.string(element.name))); 248 js.string(element.name)));
249 }); 249 });
250 250
251 return new js.Property(js.string(MANGLED_GLOBAL_NAMES), 251 return new js.Property(js.string(MANGLED_GLOBAL_NAMES),
252 new js.ObjectInitializer(names)); 252 new js.ObjectInitializer(names));
253 } 253 }
254 254
255 List<js.Property> emitLoadUrisAndHashes(Map<String, List<Fragment>> loadMap) { 255 List<js.Property> emitLoadUrisAndHashes(Map<String, List<Fragment>> loadMap) {
256 js.ArrayInitializer outputUris(List<Fragment> fragments) { 256 js.ArrayInitializer outputUris(List<Fragment> fragments) {
257 return js.stringArray(fragments.map((DeferredFragment fragment) => 257 return js.stringArray(fragments.map((DeferredFragment fragment) =>
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 913
914 var end = Date.now(); 914 var end = Date.now();
915 print('Setup: ' + (end - start) + ' ms.'); 915 print('Setup: ' + (end - start) + ' ms.');
916 916
917 #main(); // Start main. 917 #main(); // Start main.
918 918
919 }(Date.now(), #code) 919 }(Date.now(), #code)
920 }"""; 920 }""";
921 921
922 } 922 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698