| OLD | NEW |
| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 js.Property emitMangledGlobalNames() { | 251 js.Property emitMangledGlobalNames() { |
| 252 List<js.Property> names = <js.Property>[]; | 252 List<js.Property> names = <js.Property>[]; |
| 253 | 253 |
| 254 // We want to keep the original names for the most common core classes when | 254 // We want to keep the original names for the most common core classes when |
| 255 // calling toString on them. | 255 // calling toString on them. |
| 256 List<ClassElement> nativeClassesNeedingUnmangledName = | 256 List<ClassElement> nativeClassesNeedingUnmangledName = |
| 257 [compiler.intClass, compiler.doubleClass, compiler.numClass, | 257 [compiler.intClass, compiler.doubleClass, compiler.numClass, |
| 258 compiler.stringClass, compiler.boolClass, compiler.nullClass, | 258 compiler.stringClass, compiler.boolClass, compiler.nullClass, |
| 259 compiler.listClass]; | 259 compiler.listClass]; |
| 260 nativeClassesNeedingUnmangledName.forEach((element) { | 260 nativeClassesNeedingUnmangledName.forEach((element) { |
| 261 names.add(new js.Property(js.string(namer.className(element)), | 261 names.add(new js.Property(js.string(namer.getNameOfClass(element)), |
| 262 js.string(element.name))); | 262 js.string(element.name))); |
| 263 }); | 263 }); |
| 264 | 264 |
| 265 return new js.Property(js.string(MANGLED_GLOBAL_NAMES), | 265 return new js.Property(js.string(MANGLED_GLOBAL_NAMES), |
| 266 new js.ObjectInitializer(names)); | 266 new js.ObjectInitializer(names)); |
| 267 } | 267 } |
| 268 | 268 |
| 269 js.Statement emitDeferredInitializerGlobal(Map loadMap) { | 269 js.Statement emitDeferredInitializerGlobal(Map loadMap) { |
| 270 if (loadMap.isEmpty) return new js.Block.empty(); | 270 if (loadMap.isEmpty) return new js.Block.empty(); |
| 271 | 271 |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 | 979 |
| 980 var end = Date.now(); | 980 var end = Date.now(); |
| 981 // print('Setup: ' + (end - start) + ' ms.'); | 981 // print('Setup: ' + (end - start) + ' ms.'); |
| 982 | 982 |
| 983 #invokeMain; // Start main. | 983 #invokeMain; // Start main. |
| 984 | 984 |
| 985 }(Date.now(), #code) | 985 }(Date.now(), #code) |
| 986 }"""; | 986 }"""; |
| 987 | 987 |
| 988 } | 988 } |
| OLD | NEW |