OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// Transfomer that combines multiple dart script tags into a single one. | 5 /// Transfomer that combines multiple dart script tags into a single one. |
6 library polymer.src.build.script_compactor; | 6 library polymer.src.build.script_compactor; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 | 10 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if (url == null) continue; | 391 if (url == null) continue; |
392 code.writeln("import '$url' as i$i;"); | 392 code.writeln("import '$url' as i$i;"); |
393 prefixes[id] = 'i$i'; | 393 prefixes[id] = 'i$i'; |
394 i++; | 394 i++; |
395 } | 395 } |
396 | 396 |
397 // Include smoke initialization. | 397 // Include smoke initialization. |
398 generator.writeImports(code); | 398 generator.writeImports(code); |
399 generator.writeTopLevelDeclarations(code); | 399 generator.writeTopLevelDeclarations(code); |
400 code.writeln('\nvoid main() {'); | 400 code.writeln('\nvoid main() {'); |
401 generator.writeInitCall(code); | 401 code.write(' useGeneratedCode('); |
| 402 generator.writeStaticConfiguration(code); |
| 403 code.writeln(');'); |
402 if (experimentalBootstrap) { | 404 if (experimentalBootstrap) { |
403 code.write(' startPolymer(['); | 405 code.write(' startPolymer(['); |
404 } else { | 406 } else { |
405 code.write(' configureForDeployment(['); | 407 code.write(' configureForDeployment(['); |
406 } | 408 } |
407 | 409 |
408 // Include initializers to switch from mirrors_loader to static_loader. | 410 // Include initializers to switch from mirrors_loader to static_loader. |
409 if (!initializers.isEmpty) { | 411 if (!initializers.isEmpty) { |
410 code.writeln(); | 412 code.writeln(); |
411 for (var init in initializers) { | 413 for (var init in initializers) { |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 for (var c in combinators) { | 784 for (var c in combinators) { |
783 if (c is ShowElementCombinator) { | 785 if (c is ShowElementCombinator) { |
784 var show = c.shownNames.toSet(); | 786 var show = c.shownNames.toSet(); |
785 elements.retainWhere((e) => show.contains(e.displayName)); | 787 elements.retainWhere((e) => show.contains(e.displayName)); |
786 } else if (c is HideElementCombinator) { | 788 } else if (c is HideElementCombinator) { |
787 var hide = c.hiddenNames.toSet(); | 789 var hide = c.hiddenNames.toSet(); |
788 elements.removeWhere((e) => hide.contains(e.displayName)); | 790 elements.removeWhere((e) => hide.contains(e.displayName)); |
789 } | 791 } |
790 } | 792 } |
791 } | 793 } |
OLD | NEW |