anchor.diff:        int ownerIndex = classes.indexOf(element.enclosingElement);
         String metadataCode;
         if (_capabilities._supportsMetadata) {
  -        metadataCode = _extractMetadataCode(element, resolver, importCollector);
  +        metadataCode = _extractMetadataCode(
  +            element, resolver, importCollector, logger, dataId);
         } else {
           metadataCode = null;
         }
  
positive.code:       int ownerIndex = classes.indexOf(element.enclosingElement);
        String metadataCode;
        if (_capabilities._supportsMetadata) {
          metadataCode = _extractMetadataCode(element, resolver, importCollector);
        } else {
          metadataCode = null;
        }
  
negative.code:   for (Annotation annotationNode in annotatedNode.metadata) {
      // TODO(sigurdm): Emit a warning/error if the element is not in the global
      // public scope of the library.
      if (annotationNode.element == null) {
        // Some internal constants (mainly in dart:html) cannot be resolved by
        // the analyzer. Ignore them.
        // TODO(sigurdm) clarify: Investigate this, and see if these constants can
        // somehow be included.
        logger.fine("Ignoring unresolved metadata $annotationNode",
            asset: resolver.getSourceAssetId(element),
            span: resolver.getSourceSpan(element));
        continue;
      }
  
      LibraryElement library = annotationNode.element.library;
      Uri importUri = resolver.getImportUri(library, from: dataId);
      if (annotationNode.element.isPrivate ||
          (importUri.scheme == "dart" &&
              !sdkLibraryNames.contains(importUri.path))) {
        // Private constants, and constants made of classes in internal libraries
        // cannot be represented.
        // Skip them.
        // TODO(sigurdm) clarify: Investigate this, and see if these constants can
        // somehow be included.
        logger.fine("Ignoring unrepresentable metadata $annotationNode",
            asset: resolver.getSourceAssetId(element),
            span: resolver.getSourceSpan(element));
        continue;
      }
      importCollector._addLibrary(library);
      String prefix = importCollector._getPrefix(library);
      if (annotationNode.arguments != null) {
        // A const constructor.
        String constructor = (annotationNode.constructorName == null)
  