OLD | NEW |
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 import 'dart:math' as math; | 10 import 'dart:math' as math; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 case api.Diagnostic.INFO: | 161 case api.Diagnostic.INFO: |
162 case api.Diagnostic.VERBOSE_INFO: | 162 case api.Diagnostic.VERBOSE_INFO: |
163 return 'Info: $message'; | 163 return 'Info: $message'; |
164 } | 164 } |
165 throw 'Unexpected diagnostic kind: $kind (${kind.ordinal})'; | 165 throw 'Unexpected diagnostic kind: $kind (${kind.ordinal})'; |
166 } | 166 } |
167 | 167 |
168 @override | 168 @override |
169 void report(var code, Uri uri, int begin, int end, String message, | 169 void report(var code, Uri uri, int begin, int end, String message, |
170 api.Diagnostic kind) { | 170 api.Diagnostic kind) { |
171 // TODO(ahe): Remove this when source map is handled differently. | |
172 if (identical(kind.name, 'source map')) return; | |
173 | |
174 if (isAborting) return; | 171 if (isAborting) return; |
175 isAborting = (kind == api.Diagnostic.CRASH); | 172 isAborting = (kind == api.Diagnostic.CRASH); |
176 | 173 |
177 bool fatal = (kind.ordinal & FATAL) != 0; | 174 bool fatal = (kind.ordinal & FATAL) != 0; |
178 bool isInfo = (kind.ordinal & INFO) != 0; | 175 bool isInfo = (kind.ordinal & INFO) != 0; |
179 if (isInfo && uri == null && kind != api.Diagnostic.INFO) { | 176 if (isInfo && uri == null && kind != api.Diagnostic.INFO) { |
180 info(message, kind); | 177 info(message, kind); |
181 return; | 178 return; |
182 } | 179 } |
183 | 180 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 var onAdd, onClose; | 338 var onAdd, onClose; |
342 | 339 |
343 EventSinkWrapper(this.onAdd, this.onClose); | 340 EventSinkWrapper(this.onAdd, this.onClose); |
344 | 341 |
345 void add(String data) => onAdd(data); | 342 void add(String data) => onAdd(data); |
346 | 343 |
347 void addError(error, [StackTrace stackTrace]) => throw error; | 344 void addError(error, [StackTrace stackTrace]) => throw error; |
348 | 345 |
349 void close() => onClose(); | 346 void close() => onClose(); |
350 } | 347 } |
OLD | NEW |