| 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 '../../js/js.dart' as js; | 8 import '../../js/js.dart' as js; |
| 9 import '../../js_backend/js_backend.dart' show | 9 import '../../js_backend/js_backend.dart' show |
| 10 JavaScriptBackend, | 10 JavaScriptBackend, |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 if (globals.isEmpty) return new js.Block.empty(); | 133 if (globals.isEmpty) return new js.Block.empty(); |
| 134 | 134 |
| 135 js.ObjectInitializer globalsObject = new js.ObjectInitializer(globals); | 135 js.ObjectInitializer globalsObject = new js.ObjectInitializer(globals); |
| 136 | 136 |
| 137 List<js.Statement> statements = | 137 List<js.Statement> statements = |
| 138 [new js.ExpressionStatement( | 138 [new js.ExpressionStatement( |
| 139 new js.VariableDeclarationList( | 139 new js.VariableDeclarationList( |
| 140 [new js.VariableInitialization( | 140 [new js.VariableInitialization( |
| 141 new js.VariableDeclaration(r"init", allowRename: false), | 141 new js.VariableDeclaration("init", allowRename: false), |
| 142 globalsObject)]))]; | 142 globalsObject)]))]; |
| 143 return new js.Block(statements); | 143 return new js.Block(statements); |
| 144 } | 144 } |
| 145 | 145 |
| 146 List<js.Property> emitLoadUrisAndHashes(Map<String, List<Output>> loadMap) { | 146 List<js.Property> emitLoadUrisAndHashes(Map<String, List<Output>> loadMap) { |
| 147 js.ArrayInitializer outputUris(List<Output> outputs) { | 147 js.ArrayInitializer outputUris(List<Output> outputs) { |
| 148 return js.stringArray(outputs.map((DeferredOutput output) => | 148 return js.stringArray(outputs.map((DeferredOutput output) => |
| 149 "${output.outputFileName}$deferredExtension")); | 149 "${output.outputFileName}$deferredExtension")); |
| 150 } | 150 } |
| 151 js.ArrayInitializer outputHashes(List<Output> outputs) { | 151 js.ArrayInitializer outputHashes(List<Output> outputs) { |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 var end = Date.now(); | 545 var end = Date.now(); |
| 546 print('Setup: ' + (end - start) + ' ms.'); | 546 print('Setup: ' + (end - start) + ' ms.'); |
| 547 | 547 |
| 548 #main(); // Start main. | 548 #main(); // Start main. |
| 549 | 549 |
| 550 }(Date.now(), #code) | 550 }(Date.now(), #code) |
| 551 }"""; | 551 }"""; |
| 552 | 552 |
| 553 } | 553 } |
| OLD | NEW |