anchor.diff:      });
   }
   
  -/// For a [library] and its corresponding [mirror] that we believe come
  -/// from a package (because it has a file
  -/// URI) look for the package name and set it on [library].
  -void _findPackage(Library library, LibraryMirror mirror) {
  -    if (mirror.uri.scheme != 'file') return;
  -    var filePath = mirror.uri.toFilePath();
  -    // We assume that we are documenting only libraries under package/lib
  -    var rootdir = path.dirname((path.dirname(filePath)));
  -    var pubspec = path.join(rootdir, 'pubspec.yaml');
  -    library.packageName = _packageName(pubspec);
  +/// For a library's [mirror], determine the name of the package (if any) we
  +/// believe it came from (because of its file URI).
  +///
  +/// If [library] is specified, we set the packageName field. If no package could
  +/// be determined, we return an empty string.
  +String _findPackage(LibraryMirror mirror, [Library library]) {
  +  if (mirror.uri.scheme != 'file') return '';
  +  var filePath = mirror.uri.toFilePath();
  +  // We assume that we are documenting only libraries under package/lib
  +  var rootdir = path.dirname((path.dirname(filePath)));
  +  var pubspec = path.join(rootdir, 'pubspec.yaml');
  +  var packageName = _packageName(pubspec);
  +  if (library != null) {
  +    library.packageName = packageName;
       // If we are the main library in a package, associate the package readme
       // with us.
       // TODO(alanknight): We can't really rely on all packages having a library
  
positive.code: 
    var memberScope = currentMember == null ?
        null : lookupFunc(currentMember, name);
    if (memberScope != null) return docName(memberScope);
  
    var classScope = currentClass;
    while (classScope != null) {
      var classFunc = lookupFunc(currentClass, name);
      if (classFunc != null) return docName(classFunc);
      classScope = classScope.superclass;
    }
  
    var libraryScope = currentLibrary == null ?
        null : lookupFunc(currentLibrary, name);
    if (libraryScope != null) return docName(libraryScope);
  
    // Look in the dart core library scope.
    var coreScope = _coreLibrary == null? null : lookupFunc(_coreLibrary, name);
    if (coreScope != null) return docName(_coreLibrary);
  
    // If it's a reference that starts with a another library name, then it
    // looks for a match of that library name in the other sdk libraries.
  
negative.code:       _methods(library.functions),
        _variables(library.variables),
        _isHidden(library));
    _findPackage(library, result);
    logger.fine('Generated library for ${result.name}');
    return result;
  }
  