Function instrument

Instrument a parsed JavaScript program. It chains transpile, weaveStandard or weaveFlexible, and retropile.

AranInputError If conf is invalid or if the top level properties of file are invalid.

AranSyntaxError If there is problem with the AST at file.root either because there is an early syntax error or because it is not a valid ESTree program.

AranPointcutError If there is a problem with the provided pointcut.

AranClashError If there is a clash between Aran variables and the variable in file.root.

  • Type Parameters

    • path = string

      The type of file.path.

    • hash extends string | number = string

      The type returned by conf.digest.

    Parameters

    • file: Partial<File<{
          FilePath: path;
      }>>

      The parsed JavaScript program to instrument.

    • Optionalconf: null | Partial<Config<{
          FilePath: path;
          NodeHash: hash;
          Tag: hash;
      }>>

      Instrumentation options.

    Returns Program<{}> & {
        warnings: Warning[];
    }

    The instrumented program along with warnings. Can be fed to a estree code generator like astring.