anchor.diff:  
     /// Returns the absolute path wrt. to the given environment or null, if the
     /// import could not be resolved.
  -  String resolve(String uri) {
  -    if (uri.startsWith(DART_PREFIX)) {
  +  String resolve(String scriptUri) {
  +    var uri = Uri.parse(scriptUri);
  +    if (uri.scheme == 'dart') {
         // Ignore the SDK
         return null;
       }
  -    if (uri.startsWith(PACKAGE_PREFIX)) {
  +    if (uri.scheme == 'package') {
         // TODO(cbracken) belongs in a Bazel package
  -      var path = uri.substring(PACKAGE_PREFIX.length);
  -      return _resolveBazelPackage(path);
  +      return _resolveBazelPackage(uri.pathSegments);
       }
  -    if (uri.startsWith(FILE_PREFIX)) {
  -      var runfilesPathSegment = '$RUNFILES_SUFFIX/$workspacePath';
  +    if (uri.scheme == 'file') {
  +      var runfilesPathSegment = '.runfiles/$workspacePath';
         runfilesPathSegment =
             runfilesPathSegment.replaceAll(new RegExp(r'/*$'), '/');
  -      var runfilesPos = uri.indexOf(runfilesPathSegment);
  +      var runfilesPos = uri.path.indexOf(runfilesPathSegment);
         if (runfilesPos >= 0) {
           int pathStart = runfilesPos + runfilesPathSegment.length;
  -        return uri.substring(pathStart);
  +        return uri.path.substring(pathStart);
         }
         return null;
       }
  -    if (uri.startsWith(HTTPS_PREFIX)) {
  -      return _extractHttpPath(uri, HTTPS_PREFIX);
  -    }
  -    if (uri.startsWith(HTTP_PREFIX)) {
  -      return _extractHttpPath(uri, HTTP_PREFIX);
  +    if (uri.scheme == 'https' || uri.scheme == 'http') {
  +      return _extractHttpPath(uri);
       }
       // We cannot deal with anything else.
  -    failed.add(uri);
  +    failed.add('$uri');
       return null;
     }
   
  -  String _extractHttpPath(String uri, String prefix) {
  -    uri = uri.substring(prefix.length);
  -    int packagesPos = uri.indexOf(PACKAGES_SEGMENT);
  +  String _extractHttpPath(Uri uri) {
  +    int packagesPos = uri.pathSegments.indexOf('packages');
       if (packagesPos >= 0) {
  -      return _resolveBazelPackage(
  -          uri.substring(packagesPos + PACKAGES_SEGMENT.length));
  +      var workspacePath = uri.pathSegments.sublist(packagesPos + 1);
  +      return _resolveBazelPackage(workspacePath);
       }
  -    int pathPos = uri.indexOf('/');
  -    return pathPos >= 0 ? uri.substring(pathPos + 1) : uri;
  +    return uri.pathSegments.join('/');
     }
   
  -  String _resolveBazelPackage(String uriPath) {
  +  String _resolveBazelPackage(List<String> pathSegments) {
       // TODO(cbracken) belongs in a Bazel package
  -    var slashPos = uriPath.indexOf('/');
  -    var packageName = uriPath.substring(0, slashPos);
  -    var packageFile = uriPath.substring(slashPos + 1);
  +    var packageName = pathSegments[0];
  +    var pathInPackage = pathSegments.sublist(1).join('/');
       var packagePath;
       if (packageName.contains('.')) {
         packagePath = packageName.replaceAll('.', '/');
       } else {
         packagePath = 'third_party/dart/$packageName';
       }
  -    return '$packagePath/lib/$packageFile';
  +    return '$packagePath/lib/$pathInPackage';
     }
   }
   
  
positive.code: 
  /// [Resolver] resolves imports with respect to a given environment.
  class Resolver {
    static const DART_PREFIX = 'dart:';
    static const PACKAGE_PREFIX = 'package:';
    static const FILE_PREFIX = 'file://';
  
    final String packageRoot;
    final String sdkRoot;
    final List<String> failed = [];
  
negative.code: 
    /// Returns the absolute path wrt. to the given environment or null, if the
    /// import could not be resolved.
    String resolve(String scriptUri) {
      var uri = Uri.parse(scriptUri);
      if (uri.scheme == 'dart') {
        if (sdkRoot == null) {
          // No sdk-root given, do not resolve dart: URIs.
          return null;
        }
        var filePath;
        if (uri.pathSegments.length > 1) {
          var path = uri.pathSegments[0];
          // Drop patch files, since we don't have their source in the compiled
          // SDK.
          if (path.endsWith('-patch')) {
            failed.add('$uri');
            return null;
          }
          // Canonicalize path. For instance: _collection-dev => _collection_dev.
          path = path.replaceAll('-', '_');
          var pathSegments = [sdkRoot, path]
              ..addAll(uri.pathSegments.sublist(1));
          filePath = p.joinAll(pathSegments);
        } else {
          // Resolve 'dart:something' to be something/something.dart in the SDK.
          var lib = uri.path;
          filePath = p.join(sdkRoot, lib, '$lib.dart');
        }
        return resolveSymbolicLinks(filePath);
      }
      if (uri.scheme == 'package') {
        if (packageRoot == null) {
          // No package-root given, do not resolve package: URIs.
          return null;
        }
        return resolveSymbolicLinks(p.join(packageRoot, uri.path));
      }
      if (uri.scheme == 'file') {
        return resolveSymbolicLinks(p.fromUri(uri));
      }
      // We cannot deal with anything else.
      failed.add('$uri');
      return null;
    }
  
  