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

Method as_const

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

Source from the content-addressed store, hash-verified

837 ctx: str
838
839 def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
840 if self.ctx != "load":
841 raise Impossible()
842
843 eval_ctx = get_eval_context(self, eval_ctx)
844
845 try:
846 return eval_ctx.environment.getitem(
847 self.node.as_const(eval_ctx), self.arg.as_const(eval_ctx)
848 )
849 except Exception as e:
850 raise Impossible() from e
851
852
853class Getattr(Expr):

Callers

nothing calls this directly

Calls 4

ImpossibleClass · 0.70
get_eval_contextFunction · 0.70
getitemMethod · 0.45
as_constMethod · 0.45

Tested by

no test coverage detected