Index: dart/pkg/compiler/lib/src/script.dart |
diff --git a/dart/pkg/compiler/lib/src/script.dart b/dart/pkg/compiler/lib/src/script.dart |
index 9ceafb468094b622877a28b7e9c45a18487293f6..54bd63153254e7867f878e27d72e10211eaa71b6 100644 |
--- a/dart/pkg/compiler/lib/src/script.dart |
+++ b/dart/pkg/compiler/lib/src/script.dart |
@@ -26,4 +26,9 @@ class Script { |
String get text => (file == null) ? null : file.slowText(); |
String get name => (file == null) ? null : file.filename; |
+ |
+ /// Creates a new [Script] with the same URIs, but new content ([file]). |
+ Script copyWithFile(SourceFile file) { |
+ return new Script(readableUri, resourceUri, file); |
+ } |
} |