anchor.diff:    return path;
   }
   
  +engine.CompilationUnitElement _getUnitElement(engine.Element element) {
  +  if (element is engine.CompilationUnitElement) {
  +    return element;
  +  }
  +  if (element?.enclosingElement is engine.LibraryElement) {
  +    element = element.enclosingElement;
  +  }
  +  if (element is engine.LibraryElement) {
  +    return element.definingCompilationUnit;
  +  }
  +  for (; element != null; element = element.enclosingElement) {
  +    if (element is engine.CompilationUnitElement) {
  +      return element;
  +    }
  +  }
  +  return null;
  +}
  +
   /**
    * Creates a new [Location].
    */
  -Location _locationForArgs(engine.AnalysisContext context, engine.Source source,
  -    engine.SourceRange range) {
  +Location _locationForArgs(
  +    engine.CompilationUnitElement unitElement, engine.SourceRange range) {
     int startLine = 0;
     int startColumn = 0;
     try {
  -    engine.LineInfo lineInfo = context.computeLineInfo(source);
  +    engine.LineInfo lineInfo = unitElement.lineInfo;
       if (lineInfo != null) {
         engine.LineInfo_Location offsetLocation =
             lineInfo.getLocation(range.offset);
  
positive.code:   engine.CompilationUnit unit =
        node.getAncestor((node) => node is engine.CompilationUnit);
    engine.CompilationUnitElement unitElement = unit.element;
    engine.AnalysisContext context = unitElement.context;
    engine.Source source = unitElement.source;
    engine.SourceRange range = new engine.SourceRange(node.offset, node.length);
    return _locationForArgs(context, source, range);
  }
  
  /**
  
negative.code:     offset = 0;
      length = 0;
    }
    engine.CompilationUnitElement unitElement = _getUnitElement(element);
    engine.SourceRange range = new engine.SourceRange(offset, length);
    return _locationForArgs(unitElement, range);
  }
  
  /**
   * Create a Location based on an [engine.SearchMatch].
   */
  Location newLocation_fromMatch(engine.SearchMatch match) {
    engine.CompilationUnitElement unitElement = _getUnitElement(match.element);
    return _locationForArgs(unitElement, match.sourceRange);
  }
  
  /**
  