Chromium Code Reviews| 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) => |