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

Side by Side Diff: lib/src/build_result.dart

Issue 1947773002: Fix all strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/barback@master
Patch Set: Code review changes Created 4 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
« no previous file with comments | « lib/src/asset/internal_asset.dart ('k') | lib/src/errors.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 barback.build_result; 5 library barback.build_result;
6 6
7 import 'errors.dart'; 7 import 'errors.dart';
8 import 'utils.dart'; 8 import 'utils.dart';
9 9
10 /// An event indicating that the cascade has finished building all assets. 10 /// An event indicating that the cascade has finished building all assets.
(...skipping 26 matching lines...) Expand all
37 factory BuildResult.aggregate(Iterable<BuildResult> results) { 37 factory BuildResult.aggregate(Iterable<BuildResult> results) {
38 var errors = unionAll(results.map((result) => result.errors)); 38 var errors = unionAll(results.map((result) => result.errors));
39 return new BuildResult(errors); 39 return new BuildResult(errors);
40 } 40 }
41 41
42 String toString() { 42 String toString() {
43 if (succeeded) return "success"; 43 if (succeeded) return "success";
44 44
45 return "errors:\n" + errors.map((error) { 45 return "errors:\n" + errors.map((error) {
46 var stackTrace = null; 46 var stackTrace = null;
47 if (error is TransformerException || error is AssetLoadException) { 47 if (error is TransformerException) {
48 stackTrace = error.stackTrace.terse;
49 } else if (error is AssetLoadException) {
48 stackTrace = error.stackTrace.terse; 50 stackTrace = error.stackTrace.terse;
49 } 51 }
50 52
51 var msg = new StringBuffer(); 53 var msg = new StringBuffer();
52 msg.write(prefixLines(error.toString())); 54 msg.write(prefixLines(error.toString()));
53 if (stackTrace != null) { 55 if (stackTrace != null) {
54 msg.write("\n\n"); 56 msg.write("\n\n");
55 msg.write("Stack chain:\n"); 57 msg.write("Stack chain:\n");
56 msg.write(prefixLines(stackTrace.toString())); 58 msg.write(prefixLines(stackTrace.toString()));
57 } 59 }
58 return msg.toString(); 60 return msg.toString();
59 }).join("\n\n"); 61 }).join("\n\n");
60 } 62 }
61 } 63 }
OLDNEW
« no previous file with comments | « lib/src/asset/internal_asset.dart ('k') | lib/src/errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698