MCPcopy Create free account
hub / github.com/nodejs/node / pass_eval_context

Function pass_eval_context

deps/v8/third_party/jinja2/utils.py:46–60  ·  view source on GitHub ↗

Pass the :class:`~jinja2.nodes.EvalContext` as the first argument to the decorated function when called while rendering a template. See :ref:`eval-context`. Can be used on functions, filters, and tests. If only ``EvalContext.environment`` is needed, use :func:`pass_environment`

(f: F)

Source from the content-addressed store, hash-verified

44
45
46def pass_eval_context(f: F) -> F:
47 """Pass the :class:`~jinja2.nodes.EvalContext` as the first argument
48 to the decorated function when called while rendering a template.
49 See :ref:`eval-context`.
50
51 Can be used on functions, filters, and tests.
52
53 If only ``EvalContext.environment`` is needed, use
54 :func:`pass_environment`.
55
56 .. versionadded:: 3.0.0
57 Replaces ``evalcontextfunction`` and ``evalcontextfilter``.
58 """
59 f.jinja_pass_arg = _PassArg.eval_context # type: ignore
60 return f
61
62
63def pass_environment(f: F) -> F:

Callers 1

decoratorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected