Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 2824823004: Remove Compiler and JavaScriptBackend from program_builder and collector. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index e2dadd83efe54fb44d2a32b0af178bd0665bcaee..66e73c309adc9454905ccbf67559661f267a9644 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -927,7 +927,6 @@ class DeferredLoadTask extends CompilerTask {
/// - <list of files> is a list of the filenames the must be loaded when that
/// import is loaded.
Map<String, Map<String, dynamic>> computeDeferredMap() {
- JavaScriptBackend backend = compiler.backend;
Map<String, Map<String, dynamic>> mapping =
new Map<String, Map<String, dynamic>>();
_deferredImportDescriptions.keys.forEach((_DeferredImport import) {
@@ -942,12 +941,26 @@ class DeferredLoadTask extends CompilerTask {
libraryMap["imports"][importDeferName[import]] =
outputUnits.map((OutputUnit outputUnit) {
- return backend.deferredPartFileName(outputUnit.name);
+ return deferredPartFileName(outputUnit.name);
}).toList();
});
return mapping;
}
+ /// Returns the filename for the output-unit named [name].
+ ///
+ /// The filename is of the form "<main output file>_<name>.part.js".
+ /// If [addExtension] is false, the ".part.js" suffix is left out.
+ String deferredPartFileName(String name, {bool addExtension: true}) {
+ assert(name != "");
+ String outPath = compiler.options.outputUri != null
+ ? compiler.options.outputUri.path
+ : "out";
+ String outName = outPath.substring(outPath.lastIndexOf('/') + 1);
+ String extension = addExtension ? ".part.js" : "";
+ return "${outName}_$name$extension";
+ }
+
/// Creates a textual representation of the output unit content.
String dump() {
Map<OutputUnit, List<String>> elementMap = <OutputUnit, List<String>>{};
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698