docs: public static Expression applyDirective(
        Expression expr,
        SoyJsSrcPrintDirective directive,
        List<Expression> args,
        SourceLocation location,
        ErrorReporter errorReporter) {
      List<JsExpr> argExprs = Lists.transform(args, Expression::singleExprOrName);
      JsExpr applied;
      try {
        applied = directive.applyForJsSrc(expr.singleExprOrName(), argExprs);
      } catch (Throwable t) {
        applied = report(location, directive, t, errorReporter);
      }
      RequiresCollector.IntoImmutableSet collector = new RequiresCollector.IntoImmutableSet();
      expr.collectRequires(collector);
      for (Expression arg : args) {
        arg.collectRequires(collector);
      }
      if (directive instanceof SoyLibraryAssistedJsSrcPrintDirective) {
        for (String name :
            ((SoyLibraryAssistedJsSrcPrintDirective) directive).getRequiredJsLibNames()) {
          collector.add(GoogRequire.create(name));
        }
      }
  
      ImmutableList.Builder<Statement> initialStatements =
          ImmutableList.<Statement>builder().addAll(expr.initialStatements());
      for (Expression arg : args) {
        initialStatements.addAll(arg.initialStatements());
      }
      return fromExpr(applied, collector.get()).withInitialStatements(initialStatements.build());
    }