| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Generates the code for all used classes in the program. Static fields (even | 8 * Generates the code for all used classes in the program. Static fields (even |
| 9 * in classes) are ignored, since they can be treated as non-class elements. | 9 * in classes) are ignored, since they can be treated as non-class elements. |
| 10 * | 10 * |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 if (uri.scheme == 'file' && compiler.sourceMapUri != null) { | 1311 if (uri.scheme == 'file' && compiler.sourceMapUri != null) { |
| 1312 // TODO(ahe): It is a hack to use compiler.sourceMapUri | 1312 // TODO(ahe): It is a hack to use compiler.sourceMapUri |
| 1313 // here. It should be relative to the main JavaScript | 1313 // here. It should be relative to the main JavaScript |
| 1314 // output file. | 1314 // output file. |
| 1315 uri = relativize( | 1315 uri = relativize( |
| 1316 compiler.sourceMapUri, library.canonicalUri, false); | 1316 compiler.sourceMapUri, library.canonicalUri, false); |
| 1317 } | 1317 } |
| 1318 if (buffer != null) { | 1318 if (buffer != null) { |
| 1319 var metadata = metadataEmitter.buildMetadataFunction(library); | 1319 var metadata = metadataEmitter.buildMetadataFunction(library); |
| 1320 mainBuffer | 1320 mainBuffer |
| 1321 ..write('["${library.getLibraryOrScriptName()}",$_') | 1321 ..write('["${library.getLibraryName()}",$_') |
| 1322 ..write('"${uri}",$_') | 1322 ..write('"${uri}",$_') |
| 1323 ..write(metadata == null | 1323 ..write(metadata == null |
| 1324 ? "" : jsAst.prettyPrint(metadata, compiler)) | 1324 ? "" : jsAst.prettyPrint(metadata, compiler)) |
| 1325 ..write(',$_') | 1325 ..write(',$_') |
| 1326 ..write(namer.globalObjectFor(library)) | 1326 ..write(namer.globalObjectFor(library)) |
| 1327 ..write(',$_') | 1327 ..write(',$_') |
| 1328 ..write('{$n') | 1328 ..write('{$n') |
| 1329 ..addBuffer(buffer) | 1329 ..addBuffer(buffer) |
| 1330 ..write('}'); | 1330 ..write('}'); |
| 1331 if (library == compiler.mainApp) { | 1331 if (library == compiler.mainApp) { |
| 1332 mainBuffer.write(',${n}1'); | 1332 mainBuffer.write(',${n}1'); |
| 1333 } | 1333 } |
| 1334 mainBuffer.write('],$n'); | 1334 mainBuffer.write('],$n'); |
| 1335 } | 1335 } |
| 1336 buffer = buffers[1]; | 1336 buffer = buffers[1]; |
| 1337 if (buffer != null) { | 1337 if (buffer != null) { |
| 1338 deferredLibraries | 1338 deferredLibraries |
| 1339 ..write('["${library.getLibraryOrScriptName()}",$_') | 1339 ..write('["${library.getLibraryName()}",$_') |
| 1340 ..write('"${uri}",$_') | 1340 ..write('"${uri}",$_') |
| 1341 ..write('[],$_') | 1341 ..write('[],$_') |
| 1342 ..write(namer.globalObjectFor(library)) | 1342 ..write(namer.globalObjectFor(library)) |
| 1343 ..write(',$_') | 1343 ..write(',$_') |
| 1344 ..write('{$n') | 1344 ..write('{$n') |
| 1345 ..addBuffer(buffer) | 1345 ..addBuffer(buffer) |
| 1346 ..write('}],$n'); | 1346 ..write('}],$n'); |
| 1347 } | 1347 } |
| 1348 elementBuffers[library] = const []; | 1348 elementBuffers[library] = const []; |
| 1349 } | 1349 } |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1584 } | 1584 } |
| 1585 | 1585 |
| 1586 bool isDeferred(Element element) { | 1586 bool isDeferred(Element element) { |
| 1587 return compiler.deferredLoadTask.isDeferred(element); | 1587 return compiler.deferredLoadTask.isDeferred(element); |
| 1588 } | 1588 } |
| 1589 | 1589 |
| 1590 bool get areAnyElementsDeferred { | 1590 bool get areAnyElementsDeferred { |
| 1591 return compiler.deferredLoadTask.areAnyElementsDeferred; | 1591 return compiler.deferredLoadTask.areAnyElementsDeferred; |
| 1592 } | 1592 } |
| 1593 } | 1593 } |
| OLD | NEW |