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

Unified Diff: dart/pkg/dart2js_incremental/lib/library_updater.dart

Issue 641143002: Perform incremental compilation, and run the updated program. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r41074. Created 6 years, 2 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: dart/pkg/dart2js_incremental/lib/library_updater.dart
diff --git a/dart/pkg/dart2js_incremental/lib/library_updater.dart b/dart/pkg/dart2js_incremental/lib/library_updater.dart
index 1a14ebbeacfa4a5b2e61b528d2013da858c67541..b3a6c018cb5b9ccd5cacdf64332d7d9aa80ea2bb 100644
--- a/dart/pkg/dart2js_incremental/lib/library_updater.dart
+++ b/dart/pkg/dart2js_incremental/lib/library_updater.dart
@@ -85,7 +85,7 @@ class LibraryUpdater {
} else if (library != compiler.mainApp) {
return new Future.value(false);
}
- return inputProvider(uri).then((List<int> bytes) {
+ return inputProvider(uri).then((bytes) {
return canReuseLibrary(library, bytes);
});
}
@@ -94,9 +94,9 @@ class LibraryUpdater {
///
/// This methods also computes the [updates] (patches) needed to have
/// [library] reflect the modifications in [bytes].
- bool canReuseLibrary(LibraryElement library, List<int> bytes) {
+ bool canReuseLibrary(LibraryElement library, bytes) {
logTime('Attempting to reuse mainApp.');
- String newSource = UTF8.decode(bytes);
+ String newSource = bytes is String ? bytes : UTF8.decode(bytes);
logTime('Decoded UTF8');
// TODO(ahe): Can't use compiler.mainApp in general.
@@ -188,7 +188,9 @@ class LibraryUpdater {
String computeUpdateJs() {
List<Element> updatedElements = applyUpdates();
- compiler.progress.reset();
+ if (compiler.progress != null) {
+ compiler.progress.reset();
+ }
for (Element element in updatedElements) {
compiler.enqueuer.resolution.addToWorkList(element);
}
« no previous file with comments | « dart/pkg/dart2js_incremental/lib/dart2js_incremental.dart ('k') | dart/tests/try/web/incremental_compilation_update.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698