tag | 3d7675a917c6bec4ab475fd314d8e126ebf0a204 | |
---|---|---|
tagger | Natalie Weizenbaum <nweiz@google.com> | Wed Aug 24 12:38:48 2016 -0700 |
object | 7cbba6d96b1d74e676164d3a7a871fbafd837c0c |
Fix a crashing bug.
commit | 7cbba6d96b1d74e676164d3a7a871fbafd837c0c | [log] [tgz] |
---|---|---|
author | Natalie Weizenbaum <nweiz@google.com> | Wed Aug 24 12:38:15 2016 -0700 |
committer | Natalie Weizenbaum <nweiz@google.com> | Wed Aug 24 12:38:15 2016 -0700 |
tree | 5dfcda3ccc845ad61451e378e83c859217fb7d08 | |
parent | 8a70d3e4040b2b1ae02b585dedb620eac9e3fdb5 [diff] |
Fix a crash. We were choking on URIs without path components. This doesn't come up frequently for file: URIs, but it's common for http: URIs. R=rnystrom@google.com Review URL: https://codereview.chromium.org//2268153003 .
A package that defines a common class, PackageResolver
, for defining how to resolve package:
URIs. This class may be based on the current isolate's package resolution strategy, but it may also be explicitly defined by the user—for example, you could create a resolver that represents the strategy used to compile a .dart.js
file.
The Dart VM provides two mutually exclusive means of resolving package:
URIs: a package spec and a package root.
A package spec usually comes in the form of a .packages
file on the filesystem. It defines an individual root URL for each package name, so that package:$name/$path
resolves to $root/$path
.
A package root is a single URL that acts as the base for all package:
URIs, so that package:$name/$path
resolves to $base/$name/$path
.
This normalizes access to these resolution schemes, and makes it easy for code to resolve package URIs no matter where the resolution information comes from.