| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.translate_uri; | 5 library fasta.translate_uri; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:convert' show JSON; | 9 import 'dart:convert' show JSON; |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 Future<Map<String, Uri>> computeLibraries( | 94 Future<Map<String, Uri>> computeLibraries( |
| 95 FileSystem fileSystem, Uri uri) async { | 95 FileSystem fileSystem, Uri uri) async { |
| 96 if (uri == null) return const <String, Uri>{}; | 96 if (uri == null) return const <String, Uri>{}; |
| 97 Map<String, String> libraries = JSON | 97 Map<String, String> libraries = JSON |
| 98 .decode(await fileSystem.entityForUri(uri).readAsString())["libraries"]; | 98 .decode(await fileSystem.entityForUri(uri).readAsString())["libraries"]; |
| 99 Map<String, Uri> result = <String, Uri>{}; | 99 Map<String, Uri> result = <String, Uri>{}; |
| 100 libraries.forEach((String name, String path) { | 100 libraries.forEach((String name, String path) { |
| 101 result[name] = uri.resolve(path); | 101 result[name] = uri.resolveUri(new Uri.file(path)); |
| 102 }); | 102 }); |
| 103 return result; | 103 return result; |
| 104 } | 104 } |
| 105 | 105 |
| 106 Future<Map<String, List<Uri>>> computePatches( | 106 Future<Map<String, List<Uri>>> computePatches( |
| 107 FileSystem fileSystem, Uri uri) async { | 107 FileSystem fileSystem, Uri uri) async { |
| 108 // TODO(ahe): Read patch information. | 108 // TODO(ahe): Read patch information. |
| 109 return const <String, List<Uri>>{}; | 109 return const <String, List<Uri>>{}; |
| 110 } | 110 } |
| OLD | NEW |