| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Implementations of [Packages] that may be used in either server or browser | 5 /// Implementations of [Packages] that may be used in either server or browser |
| 6 /// based applications. For implementations that can only run in the browser, | 6 /// based applications. For implementations that can only run in the browser, |
| 7 /// see [package_config.packages_io_impl]. | 7 /// see [package_config.packages_io_impl]. |
| 8 library package_config.packages_impl; | 8 library package_config.packages_impl; |
| 9 | 9 |
| 10 import "dart:collection" show UnmodifiableMapView; | 10 import "dart:collection" show UnmodifiableMapView; |
| 11 |
| 11 import "../packages.dart"; | 12 import "../packages.dart"; |
| 12 import "util.dart" show checkValidPackageUri; | 13 import "util.dart" show checkValidPackageUri; |
| 13 | 14 |
| 14 /// A [Packages] null-object. | 15 /// A [Packages] null-object. |
| 15 class NoPackages implements Packages { | 16 class NoPackages implements Packages { |
| 16 const NoPackages(); | 17 const NoPackages(); |
| 17 | 18 |
| 18 Uri resolve(Uri packageUri, {Uri notFound(Uri packageUri)}) { | 19 Uri resolve(Uri packageUri, {Uri notFound(Uri packageUri)}) { |
| 19 String packageName = checkValidPackageUri(packageUri); | 20 String packageName = checkValidPackageUri(packageUri); |
| 20 if (notFound != null) return notFound(packageUri); | 21 if (notFound != null) return notFound(packageUri); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 86 } |
| 86 | 87 |
| 87 Iterable<String> get packages { | 88 Iterable<String> get packages { |
| 88 throw _failListingPackages(); | 89 throw _failListingPackages(); |
| 89 } | 90 } |
| 90 | 91 |
| 91 Map<String, Uri> asMap() { | 92 Map<String, Uri> asMap() { |
| 92 throw _failListingPackages(); | 93 throw _failListingPackages(); |
| 93 } | 94 } |
| 94 } | 95 } |
| OLD | NEW |