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

Method as_const

deps/v8/third_party/jinja2/nodes.py:918–934  ·  view source on GitHub ↗
(self, eval_ctx: t.Optional[EvalContext] = None)

Source from the content-addressed store, hash-verified

916 ops: t.List["Operand"]
917
918 def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
919 eval_ctx = get_eval_context(self, eval_ctx)
920 result = value = self.expr.as_const(eval_ctx)
921
922 try:
923 for op in self.ops:
924 new_value = op.expr.as_const(eval_ctx)
925 result = _cmpop_to_func[op.op](value, new_value)
926
927 if not result:
928 return False
929
930 value = new_value
931 except Exception as e:
932 raise Impossible() from e
933
934 return result
935
936
937class Operand(Helper):

Callers

nothing calls this directly

Calls 3

get_eval_contextFunction · 0.70
ImpossibleClass · 0.70
as_constMethod · 0.45

Tested by

no test coverage detected