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

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

Issue 1975153002: Support (de)serialization from command-line (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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
Index: pkg/compiler/lib/src/source_file_provider.dart
diff --git a/pkg/compiler/lib/src/source_file_provider.dart b/pkg/compiler/lib/src/source_file_provider.dart
index 7fae6f2dc29c03f43885d2376d5138f70271e4ed..57bc9d36256f3b03b7cb4f3c0331c6b6192552a1 100644
--- a/pkg/compiler/lib/src/source_file_provider.dart
+++ b/pkg/compiler/lib/src/source_file_provider.dart
@@ -241,6 +241,7 @@ typedef void MessageCallback(String message);
class RandomAccessFileOutputProvider implements CompilerOutput {
final Uri out;
final Uri sourceMapOut;
+ final Uri resolutionOutput;
final MessageCallback onInfo;
final MessageCallback onFailure;
@@ -248,7 +249,7 @@ class RandomAccessFileOutputProvider implements CompilerOutput {
List<String> allOutputFiles = new List<String>();
RandomAccessFileOutputProvider(this.out, this.sourceMapOut,
- {this.onInfo, this.onFailure});
+ {this.onInfo, this.onFailure, this.resolutionOutput});
static Uri computePrecompiledUri(Uri out) {
String extension = 'precompiled.js';
@@ -264,7 +265,7 @@ class RandomAccessFileOutputProvider implements CompilerOutput {
EventSink<String> call(String name, String extension) {
return createEventSink(name, extension);
}
-
+
EventSink<String> createEventSink(String name, String extension) {
Uri uri;
bool isPrimaryOutput = false;
@@ -282,9 +283,14 @@ class RandomAccessFileOutputProvider implements CompilerOutput {
" \"Content-Security-Policy: script-src 'self'\"");
} else if (extension == 'js.map' || extension == 'dart.map') {
uri = sourceMapOut;
- } else if (extension == "info.json") {
+ } else if (extension == 'info.json') {
String outName = out.path.substring(out.path.lastIndexOf('/') + 1);
uri = out.resolve('$outName.$extension');
+ } else if (extension == 'data') {
+ if (resolutionOutput == null) {
+ onFailure('Serialization target unspecified.');
+ }
+ uri = resolutionOutput;
} else {
onFailure('Unknown extension: $extension');
}
« no previous file with comments | « pkg/compiler/lib/src/serialization/task.dart ('k') | tests/compiler/dart2js/serialization/analysis_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698