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

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

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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:uri'; 8 import 'dart:uri';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:utf'; 10 import 'dart:utf';
(...skipping 27 matching lines...) Expand all
38 String source; 38 String source;
39 try { 39 try {
40 source = readAll(uriPathToNative(resourceUri.path)); 40 source = readAll(uriPathToNative(resourceUri.path));
41 } on FileIOException catch (ex) { 41 } on FileIOException catch (ex) {
42 throw 'Error: Cannot read "${relativize(cwd, resourceUri, isWindows)}" ' 42 throw 'Error: Cannot read "${relativize(cwd, resourceUri, isWindows)}" '
43 '(${ex.osError}).'; 43 '(${ex.osError}).';
44 } 44 }
45 dartCharactersRead += source.length; 45 dartCharactersRead += source.length;
46 sourceFiles[resourceUri.toString()] = 46 sourceFiles[resourceUri.toString()] =
47 new SourceFile(relativize(cwd, resourceUri, isWindows), source); 47 new SourceFile(relativize(cwd, resourceUri, isWindows), source);
48 return new Future.immediate(source); 48 return new Future.value(source);
49 } 49 }
50 } 50 }
51 51
52 class FormattingDiagnosticHandler { 52 class FormattingDiagnosticHandler {
53 final SourceFileProvider provider; 53 final SourceFileProvider provider;
54 bool showWarnings = true; 54 bool showWarnings = true;
55 bool verbose = false; 55 bool verbose = false;
56 bool isAborting = false; 56 bool isAborting = false;
57 bool enableColors = false; 57 bool enableColors = false;
58 bool throwOnError = false; 58 bool throwOnError = false;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 print(file.getLocationMessage(color(message), begin, end, true, color)); 112 print(file.getLocationMessage(color(message), begin, end, true, color));
113 } 113 }
114 if (fatal && throwOnError) { 114 if (fatal && throwOnError) {
115 isAborting = true; 115 isAborting = true;
116 throw new AbortLeg(message); 116 throw new AbortLeg(message);
117 } 117 }
118 } 118 }
119 } 119 }
120 120
121 121
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart ('k') | sdk/lib/_internal/dartdoc/lib/dartdoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698