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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 uri = out; | 268 uri = out; |
269 } else if (extension == 'precompiled.js') { | 269 } else if (extension == 'precompiled.js') { |
270 uri = computePrecompiledUri(out); | 270 uri = computePrecompiledUri(out); |
271 onInfo("File ($uri) is compatible with header" | 271 onInfo("File ($uri) is compatible with header" |
272 " \"Content-Security-Policy: script-src 'self'\""); | 272 " \"Content-Security-Policy: script-src 'self'\""); |
273 } else if (extension == 'js.map' || extension == 'dart.map') { | 273 } else if (extension == 'js.map' || extension == 'dart.map') { |
274 uri = sourceMapOut; | 274 uri = sourceMapOut; |
275 } else if (extension == "info.json") { | 275 } else if (extension == "info.json") { |
276 String outName = out.path.substring(out.path.lastIndexOf('/') + 1); | 276 String outName = out.path.substring(out.path.lastIndexOf('/') + 1); |
277 uri = out.resolve('$outName.$extension'); | 277 uri = out.resolve('$outName.$extension'); |
| 278 } else if (extension == "stats.json") { |
| 279 String outName = out.path.substring(out.path.lastIndexOf('/') + 1); |
| 280 uri = out.resolve('$outName.$extension'); |
278 } else { | 281 } else { |
279 onFailure('Unknown extension: $extension'); | 282 onFailure('Unknown extension: $extension'); |
280 } | 283 } |
281 } else { | 284 } else { |
282 uri = out.resolve('$name.$extension'); | 285 uri = out.resolve('$name.$extension'); |
283 } | 286 } |
284 | 287 |
285 if (uri.scheme != 'file') { | 288 if (uri.scheme != 'file') { |
286 onFailure('Unhandled scheme ${uri.scheme} in $uri.'); | 289 onFailure('Unhandled scheme ${uri.scheme} in $uri.'); |
287 } | 290 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 var onAdd, onClose; | 328 var onAdd, onClose; |
326 | 329 |
327 EventSinkWrapper(this.onAdd, this.onClose); | 330 EventSinkWrapper(this.onAdd, this.onClose); |
328 | 331 |
329 void add(String data) => onAdd(data); | 332 void add(String data) => onAdd(data); |
330 | 333 |
331 void addError(error, [StackTrace stackTrace]) => throw error; | 334 void addError(error, [StackTrace stackTrace]) => throw error; |
332 | 335 |
333 void close() => onClose(); | 336 void close() => onClose(); |
334 } | 337 } |
OLD | NEW |