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

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

Issue 897013003: dart2js: add common names to mangledGlobalNames in new emitter. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
index 30d81ed1bd78fa86541919b585709b48c649539f..5edc5c74c568cea9cb3bc978895bdbabe21466de 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart
@@ -209,8 +209,7 @@ class ModelEmitter {
program.typeToInterceptorMap));
}
- globals.add(new js.Property(js.string(MANGLED_GLOBAL_NAMES),
- js.js('Object.create(null)', [])));
+ globals.add(emitMangledGlobalNames());
globals.add(emitGetTypeFromName());
@@ -234,6 +233,18 @@ class ModelEmitter {
return new js.Block(statements);
}
+ js.Property emitMangledGlobalNames() {
+ List<js.Property> names = <js.Property>[];
+ [compiler.intClass, compiler.doubleClass, compiler.numClass,
floitsch 2015/02/04 16:18:28 Add comment why this is needed/wanted. Update the
zarah 2015/02/06 08:53:11 Done.
+ compiler.stringClass, compiler.boolClass, compiler.nullClass,
floitsch 2015/02/04 16:18:28 indent by 1.
zarah 2015/02/06 08:53:11 Done.
+ compiler.listClass].forEach((cls) =>
floitsch 2015/02/04 16:18:28 Don't use "cls". "Cls" is only used for "Class" in
floitsch 2015/02/04 16:18:28 Split it into smaller pieces. List<ClassElement> n
floitsch 2015/02/04 16:18:28 make this a "{}" function body.
zarah 2015/02/06 08:53:11 Done.
zarah 2015/02/06 08:53:11 Done.
zarah 2015/02/06 08:53:12 Done.
+ names.add(new js.Property(js.string(namer.getNameOfClass(cls)),
+ js.string(cls.name))));
+
+ return new js.Property(js.string(MANGLED_GLOBAL_NAMES),
+ new js.ObjectInitializer(names, isOneLiner: false));
floitsch 2015/02/04 16:18:28 I would have kept it as a one-liner.
zarah 2015/02/06 08:53:11 Done.
+ }
+
List<js.Property> emitLoadUrisAndHashes(Map<String, List<Fragment>> loadMap) {
js.ArrayInitializer outputUris(List<Fragment> fragments) {
return js.stringArray(fragments.map((DeferredFragment fragment) =>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698