docs: @CheckReturnValue
    protected Statement generateFunctionBody(TemplateNode node, String alias) {
      ImmutableList.Builder<Statement> bodyStatements = ImmutableList.builder();
      bodyStatements.add(
          Statement.assign(
              JsRuntime.OPT_IJ_DATA,
              id("opt_ijData_deprecated")
                  .or(JsRuntime.OPT_IJ_DATA, templateTranslationContext.codeGenerator())
                  .castAs("!soy.IjData")));
      if (node instanceof TemplateElementNode) {
        TemplateElementNode elementNode = (TemplateElementNode) node;
        for (TemplateStateVar stateVar : elementNode.getStateVars()) {
          Expression expr = getExprTranslator().exec(stateVar.defaultValue());
          // A  state variable can be something like ns.foo.FooProto|null. Without
          // this cast, access to this variable can trigger JS conformance errors
          // due to unknown type.
          if (!stateVar.type().equals(stateVar.defaultValue().getType())) {
            expr = expr.castAs(JsType.forJsSrc(stateVar.type()).typeExpr());
          }
          bodyStatements.add(VariableDeclaration.builder(stateVar.name()).setRhs(expr).build());
        }
      }
      // Generate statement to ensure data is defined, if necessary.
      if (new ShouldEnsureDataIsDefinedVisitor().exec(node)) {
        bodyStatements.add(
            assign(
                OPT_DATA,
                OPT_DATA.or(EMPTY_OBJECT_LITERAL, templateTranslationContext.codeGenerator())));
      }
  
      // Type check parameters.
      bodyStatements.add(genParamTypeChecks(node, alias));
  
      SanitizedContentKind kind = node.getContentKind();
      if (isComputableAsJsExprsVisitor.exec(node)) {
        // Case 1: The code style is 'concat' and the whole template body can be represented as JS
        // expressions. We specially handle this case because we don't want to generate the variable
        // 'output' at all. We simply concatenate the JS expressions and return the result.
  
        List<Expression> templateBodyChunks = genJsExprsVisitor.exec(node);
        if (kind == null) {
          // The template is not strict. Thus, it may not apply an escaping directive to *every* print
          // command, which means that some of its print commands could produce a number. Thus, there
          // is a danger that a plus operator between two expressions in the list will do numeric
          // addition instead of string concatenation. Furthermore, a non-strict template always needs
          // to return a string, but if there is just one expression in the list, and we return it as
          // is, we may not always produce a string (since an escaping directive may not be getting
          // applied in that expression at all, or a directive might be getting applied that produces
          // SanitizedContent). We thus call a method that makes sure to return an expression that
          // produces a string and is in no danger of using numeric addition when concatenating the
          // expressions in the list.
          bodyStatements.add(returnValue(CodeChunkUtils.concatChunksForceString(templateBodyChunks)));
        } else {
          // The template is strict. Thus, it applies an escaping directive to *every* print command,
          // which means that no print command produces a number, which means that there is no danger
          // of a plus operator between two print commands doing numeric addition instead of string
          // concatenation. And since a strict template needs to return SanitizedContent, it is ok to
          // get an expression that produces SanitizedContent, which is indeed possible with an
          // escaping directive that produces SanitizedContent. Thus, we do not have to be extra
          // careful when concatenating the expressions in the list.
          bodyStatements.add(
              returnValue(sanitize(CodeChunkUtils.concatChunks(templateBodyChunks), kind)));
        }
      } else {
        // Case 2: Normal case.
  
        jsCodeBuilder.pushOutputVar("output");
        Statement codeChunk = visitChildrenReturningCodeChunk(node);
        jsCodeBuilder.popOutputVar();
        bodyStatements.add(Statement.of(codeChunk, returnValue(sanitize(id("output"), kind))));
      }
      return Statement.of(bodyStatements.build());
    }