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

Class EvalContext

deps/v8/third_party/jinja2/nodes.py:69–89  ·  view source on GitHub ↗

Holds evaluation time information. Custom attributes can be attached to it in extensions.

Source from the content-addressed store, hash-verified

67
68
69class EvalContext:
70 """Holds evaluation time information. Custom attributes can be attached
71 to it in extensions.
72 """
73
74 def __init__(
75 self, environment: "Environment", template_name: t.Optional[str] = None
76 ) -> None:
77 self.environment = environment
78 if callable(environment.autoescape):
79 self.autoescape = environment.autoescape(template_name)
80 else:
81 self.autoescape = environment.autoescape
82 self.volatile = False
83
84 def save(self) -> t.Mapping[str, t.Any]:
85 return self.__dict__.copy()
86
87 def revert(self, old: t.Mapping[str, t.Any]) -> None:
88 self.__dict__.clear()
89 self.__dict__.update(old)
90
91
92def get_eval_context(node: "Node", ctx: t.Optional[EvalContext]) -> EvalContext:

Callers 4

__init__Method · 0.70
_filter_test_commonMethod · 0.70
visit_TemplateMethod · 0.70
get_eval_contextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected