Class SerializeTypedAstPass

java.lang.Object
com.google.javascript.jscomp.serialization.SerializeTypedAstPass
All Implemented Interfaces:
CompilerPass

public final class SerializeTypedAstPass extends Object implements CompilerPass
A compiler pass intended to serialize the types in the AST.

Serialization means that the AST is converted to a proto representation and output to a file or stream. Deserialization means the reverse process.

  • Method Details

    • createFromOutputStream

      public static SerializeTypedAstPass createFromOutputStream(AbstractCompiler c, OutputStream out, SerializationOptions serializationOptions)
      Serializes a TypedAst to the given output stream.

      Unlike

      invalid reference
      #createFromPath(AbstractCompiler, Path)
      , this method does not automatically gzip the TypedAST. The "out" parameter may or may not already be a GZIPOutputStream.
    • createFromPath

      public static SerializeTypedAstPass createFromPath(AbstractCompiler compiler, Path outputPath, SerializationOptions serializationOptions)
      Serializes a gzipped TypedAst to the specified outputPath
    • process

      public void process(Node externs, Node root)
      Description copied from interface: CompilerPass
      Process the JS with root node root. Can modify the contents of each Node tree
      Specified by:
      process in interface CompilerPass
      Parameters:
      externs - Top of external JS tree
      root - Top of JS tree