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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/source_file_provider.dart

Issue 256743009: Cache output of dart2js compilations that went wrong on disk. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library source_file_provider; 5 library source_file_provider;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 Future<List<int>> readUtf8BytesFromUri(Uri resourceUri) { 39 Future<List<int>> readUtf8BytesFromUri(Uri resourceUri) {
40 if (resourceUri.scheme != 'file') { 40 if (resourceUri.scheme != 'file') {
41 throw new ArgumentError("Unknown scheme in uri '$resourceUri'"); 41 throw new ArgumentError("Unknown scheme in uri '$resourceUri'");
42 } 42 }
43 List<int> source; 43 List<int> source;
44 try { 44 try {
45 source = readAll(resourceUri.toFilePath()); 45 source = readAll(resourceUri.toFilePath());
46 } on FileSystemException catch (ex) { 46 } on FileSystemException catch (ex) {
47 sourceFiles[resourceUri.toString()] = null;
47 return new Future.error( 48 return new Future.error(
48 "Error reading '${relativize(cwd, resourceUri, isWindows)}' " 49 "Error reading '${relativize(cwd, resourceUri, isWindows)}' "
49 "(${ex.osError})"); 50 "(${ex.osError})");
50 } 51 }
51 dartCharactersRead += source.length; 52 dartCharactersRead += source.length;
52 sourceFiles[resourceUri.toString()] = new Utf8BytesSourceFile( 53 sourceFiles[resourceUri.toString()] = new Utf8BytesSourceFile(
53 relativize(cwd, resourceUri, isWindows), source); 54 relativize(cwd, resourceUri, isWindows), source);
54 return new Future.value(source); 55 return new Future.value(source);
55 } 56 }
56 57
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (fatal && throwOnError) { 165 if (fatal && throwOnError) {
165 isAborting = true; 166 isAborting = true;
166 throw new AbortLeg(message); 167 throw new AbortLeg(message);
167 } 168 }
168 } 169 }
169 170
170 void call(Uri uri, int begin, int end, String message, api.Diagnostic kind) { 171 void call(Uri uri, int begin, int end, String message, api.Diagnostic kind) {
171 return diagnosticHandler(uri, begin, end, message, kind); 172 return diagnosticHandler(uri, begin, end, message, kind);
172 } 173 }
173 } 174 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart2js.dart ('k') | tests/standalone/io/skipping_dart2js_compilations_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698