| 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 typedef bool IsSafeToRemoveTypeDeclarations( | 7 typedef bool IsSafeToRemoveTypeDeclarations( |
| 8 Map<ClassElement, Iterable<Element>> classMembers); | 8 Map<ClassElement, Iterable<Element>> classMembers); |
| 9 typedef void ElementCallback<E>(E element); | 9 typedef void ElementCallback<E>(E element); |
| 10 typedef void ElementPostProcessFunction( | 10 typedef void ElementPostProcessFunction( |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 stripTypes: forceStripTypes, | 504 stripTypes: forceStripTypes, |
| 505 minify: enableMinification); | 505 minify: enableMinification); |
| 506 | 506 |
| 507 if (multiFile) { | 507 if (multiFile) { |
| 508 // TODO(sigurdm): Factor handling of library-paths out from emitting. | 508 // TODO(sigurdm): Factor handling of library-paths out from emitting. |
| 509 String mainName = outputUri.pathSegments.last; | 509 String mainName = outputUri.pathSegments.last; |
| 510 String mainBaseName = mainName.endsWith(".dart") | 510 String mainBaseName = mainName.endsWith(".dart") |
| 511 ? mainName.substring(0, mainName.length - 5) | 511 ? mainName.substring(0, mainName.length - 5) |
| 512 : mainName; | 512 : mainName; |
| 513 // Map each library to a path based on the uri of the original | 513 // Map each library to a path based on the uri of the original |
| 514 // library and [compiler.outputUri]. | 514 // library and [compiler.options.outputUri]. |
| 515 Set<String> usedLibraryPaths = new Set<String>(); | 515 Set<String> usedLibraryPaths = new Set<String>(); |
| 516 for (LibraryElement library in libraryInfo.userLibraries) { | 516 for (LibraryElement library in libraryInfo.userLibraries) { |
| 517 if (library == mainFunction.library) { | 517 if (library == mainFunction.library) { |
| 518 outputPaths[library] = mainBaseName; | 518 outputPaths[library] = mainBaseName; |
| 519 } else { | 519 } else { |
| 520 List<String> names = | 520 List<String> names = |
| 521 library.canonicalUri.pathSegments.last.split("."); | 521 library.canonicalUri.pathSegments.last.split("."); |
| 522 if (names.last == "dart") { | 522 if (names.last == "dart") { |
| 523 names = names.sublist(0, names.length - 1); | 523 names = names.sublist(0, names.length - 1); |
| 524 } | 524 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 String code = mainUnparser.result; | 595 String code = mainUnparser.result; |
| 596 outputProvider("", "dart") | 596 outputProvider("", "dart") |
| 597 ..add(code) | 597 ..add(code) |
| 598 ..close(); | 598 ..close(); |
| 599 | 599 |
| 600 totalSize = code.length; | 600 totalSize = code.length; |
| 601 } | 601 } |
| 602 | 602 |
| 603 return totalSize; | 603 return totalSize; |
| 604 } | 604 } |
| 605 } | 605 } |
| OLD | NEW |