Class PassListBuilder

java.lang.Object
com.google.javascript.jscomp.PassListBuilder

public final class PassListBuilder extends Object
This class exists to funnel the list of passes through a central mechanism to ensure that the PassFactory can define and enforce conditions that much be met in order for the pass they create to be added to the compilation process.
  • Constructor Details

  • Method Details

    • build

      public com.google.common.collect.ImmutableList<PassFactory> build()
    • addAll

      public void addAll(PassListBuilder other)
    • maybeAdd

      public void maybeAdd(PassFactory factory)
      Add only if the PassFactory condition evaluates to true.
    • addBefore

      public void addBefore(PassFactory factory, String passName)
      Insert the given pass factory before the factory of the given name. Throws if the specified pass is not present
    • addAfter

      public void addAfter(PassFactory factory, String passName)
      Insert the given pass factory before the factory of the given name. Throws if the specified pass is not present
    • addAllUpTo

      @Deprecated public void addAllUpTo(PassListBuilder other, String passName)
      Deprecated.
      replace uses of this method with a more precise definition of a pass configuration.
      Returns the list of pass up to and including the named pass, otherwise return an empty set of passes.

      Do not add new uses of this method.

    • findByName

      public PassFactory findByName(String name)
    • removeByName

      @Deprecated public void removeByName(String name)
      Deprecated.
      Do not add new uses to the method. This method exists only for migration purposes. Removing passes piecemeal is very fragile.
      Remove a pass with the specified name.
    • contains

      public boolean contains(PassFactory factory)
    • assertAllOneTimePasses

      public void assertAllOneTimePasses()
      Verify that all the passes are one-time passes.
    • assertAllLoopablePasses

      public void assertAllLoopablePasses()
      Verify that all the passes are multi-run passes.
    • assertPassOrder

      public void assertPassOrder(PassFactory pass1, PassFactory pass2, String msg)
      Asserts that if both PassFactory are present, pass1 is ordered before pass2.