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

Unified Diff: dart/site/try/poi/poi.dart

Issue 705253002: Include reasons for failing in StateError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Have poi.dart recover when LibraryUpdater failed. Created 6 years, 1 month 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 | « dart/pkg/dart2js_incremental/lib/library_updater.dart ('k') | dart/tests/try/poi/library_updater_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/poi/poi.dart
diff --git a/dart/site/try/poi/poi.dart b/dart/site/try/poi/poi.dart
index 21b1078704f77f9509df2c7872a9035cc4226392..0261ba5584fd39fa79b24a3f391446f1ad6060d9 100644
--- a/dart/site/try/poi/poi.dart
+++ b/dart/site/try/poi/poi.dart
@@ -397,22 +397,35 @@ Future<Element> runPoi(
options.add('--minify');
}
- LibraryUpdater updater =
- new LibraryUpdater(
- cachedCompiler, inputProvider, script, printWallClock, printVerbose);
+ LibraryUpdater updater;
+
Future<bool> reuseLibrary(LibraryElement library) {
return poiTask.measure(() => updater.reuseLibrary(library));
}
- return reuseCompiler(
- diagnosticHandler: handler,
- inputProvider: inputProvider,
- options: options,
- cachedCompiler: cachedCompiler,
- libraryRoot: libraryRoot,
- packageRoot: packageRoot,
- packagesAreImmutable: true,
- reuseLibrary: reuseLibrary).then((Compiler newCompiler) {
+ Future<Compiler> invokeReuseCompiler() {
+ updater = new LibraryUpdater(
+ cachedCompiler, inputProvider, script, printWallClock, printVerbose);
+ return reuseCompiler(
+ diagnosticHandler: handler,
+ inputProvider: inputProvider,
+ options: options,
+ cachedCompiler: cachedCompiler,
+ libraryRoot: libraryRoot,
+ packageRoot: packageRoot,
+ packagesAreImmutable: true,
+ reuseLibrary: reuseLibrary);
+ }
+
+ return invokeReuseCompiler().then((Compiler newCompiler) {
+ // TODO(ahe): Move this "then" block to [reuseCompiler].
+ if (updater.failed) {
+ cachedCompiler = null;
+ return invokeReuseCompiler();
+ } else {
+ return newCompiler;
+ }
+ }).then((Compiler newCompiler) {
if (!isCompiler) {
newCompiler.enqueuerFilter = new ScriptOnlyFilter(script);
}
« no previous file with comments | « dart/pkg/dart2js_incremental/lib/library_updater.dart ('k') | dart/tests/try/poi/library_updater_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698