anchor.diff:  
     // Transform the library/class members:
   
  -  void convertLibraryAnnotations(Library lib) {
  +  void convertLibrary(Library library) {
  +    transformAnnotations(library.annotations, library);
  +
  +    transformList(library.dependencies, this, library);
  +    transformList(library.parts, this, library);
  +    transformList(library.typedefs, this, library);
  +    transformList(library.classes, this, library);
  +    transformList(library.procedures, this, library);
  +    transformList(library.fields, this, library);
  +
  +    if (!keepFields) {
  +      // The transformer API does not iterate over `Library.additionalExports`,
  +      // so we manually delete the references to shaken nodes.
  +      library.additionalExports.removeWhere((Reference reference) {
  +        return reference.canonicalName == null;
  +      });
  +    }
  +  }
  +
  +  visitLibraryPart(LibraryPart node) {
       constantEvaluator.withNewEnvironment(() {
  -      transformList(lib.annotations, this, lib);
  +      transformAnnotations(node.annotations, node);
       });
  -  }
  -
  -  void convertClassAnnotations(Class klass) {
  +    return node;
  +  }
  +
  +  visitLibraryDependency(LibraryDependency node) {
       constantEvaluator.withNewEnvironment(() {
  -      transformList(klass.annotations, this, klass);
  +      transformAnnotations(node.annotations, node);
       });
  -  }
  -
  -  void convertProcedure(Procedure procedure) {
  +    return node;
  +  }
  +
  +  visitClass(Class node) {
       constantEvaluator.withNewEnvironment(() {
  -      procedure.accept(this);
  +      transformAnnotations(node.annotations, node);
  +      transformList(node.fields, this, node);
  +      transformList(node.typeParameters, this, node);
  +      transformList(node.constructors, this, node);
  +      transformList(node.procedures, this, node);
  +      transformList(node.redirectingFactoryConstructors, this, node);
       });
  -  }
  -
  -  void convertConstructor(Constructor constructor) {
  +    return node;
  +  }
  +
  +  visitProcedure(Procedure node) {
       constantEvaluator.withNewEnvironment(() {
  -      constructor.accept(this);
  +      transformAnnotations(node.annotations, node);
  +      node.function = node.function.accept(this)..parent = node;
       });
  -  }
  -
  -  void convertField(Field field) {
  +    return node;
  +  }
  +
  +  visitConstructor(Constructor node) {
       constantEvaluator.withNewEnvironment(() {
  -      if (field.accept(this) == null) field.remove();
  +      transformAnnotations(node.annotations, node);
  +      transformList(node.initializers, this, node);
  +      node.function = node.function.accept(this)..parent = node;
       });
  -  }
  -
  -  void convertTypedef(Typedef td) {
  -    // A typedef can have annotations on variables which are constants.
  +    return node;
  +  }
  +
  +  visitTypedef(Typedef node) {
       constantEvaluator.withNewEnvironment(() {
  -      td.accept(this);
  +      transformAnnotations(node.annotations, node);
       });
  +    return node;
  +  }
  +
  +  visitRedirectingFactoryConstructor(RedirectingFactoryConstructor node) {
  +    constantEvaluator.withNewEnvironment(() {
  +      transformAnnotations(node.annotations, node);
  +      transformList(node.typeParameters, this, node);
  +      transformList(node.positionalParameters, this, node);
  +      transformList(node.namedParameters, this, node);
  +    });
  +    return node;
  +  }
  +
  +  visitTypeParameter(TypeParameter node) {
  +    transformAnnotations(node.annotations, node);
  +    return node;
  +  }
  +
  +  void transformAnnotations(List<Expression> nodes, TreeNode parent) {
  +    if (evaluateAnnotations && nodes.length > 0) {
  +      constantEvaluator.withNewEnvironment(() {
  +        for (int i = 0; i < nodes.length; ++i) {
  +          nodes[i] = tryEvaluateAndTransformWithContext(parent, nodes[i])
  +            ..parent = parent;
  +        }
  +      });
  +    }
     }
   
     // Handle definition of constants:
  
positive.code:       keepFields: keepFields,
        strongMode: strongMode,
        enableAsserts: enableAsserts,
        errorReporter: errorReporter);
    return component;
  }
  
negative.code:       backend,
        keepFields,
        keepVariables,
        evaluateAnnotations,
        coreTypes,
        typeEnvironment,
        strongMode,
        enableAsserts,
        errorReporter);
    for (final Library library in libraries) {
      constantsTransformer.convertLibrary(library);
    }
  }
  
  