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

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

Issue 1819053002: Split loader from the rest of the compiler. This adds several abstractions to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add environment.dart Created 4 years, 9 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/script.dart
diff --git a/pkg/compiler/lib/src/script.dart b/pkg/compiler/lib/src/script.dart
index 3dce8e189ba4240f9f0e9042318aca929712a17d..f8278ab248923c5323a2fde94ca95f221c56c96b 100644
--- a/pkg/compiler/lib/src/script.dart
+++ b/pkg/compiler/lib/src/script.dart
@@ -27,9 +27,15 @@ class Script {
/// This script was synthesized.
final bool isSynthesized;
- Script(
- this.readableUri, this.resourceUri, this.file,
- {this.isSynthesized: false});
+ Script(this.readableUri, this.resourceUri, this.file)
+ : isSynthesized = false;
+
+ Script.synthetic(Uri uri)
+ : readableUri = uri,
+ resourceUri = uri,
+ file = new StringSourceFile.fromUri(uri,
+ "// Synthetic source file generated for '$uri'."),
+ isSynthesized = true;
String get text => (file == null) ? null : file.slowText();
String get name => (file == null) ? null : file.filename;

Powered by Google App Engine
This is Rietveld 408576698