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

Method as_const

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

Source from the content-addressed store, hash-verified

519 abstract = True
520
521 def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
522 eval_ctx = get_eval_context(self, eval_ctx)
523
524 # intercepted operators cannot be folded at compile time
525 if (
526 eval_ctx.environment.sandboxed
527 and self.operator in eval_ctx.environment.intercepted_unops # type: ignore
528 ):
529 raise Impossible()
530 f = _uaop_to_func[self.operator]
531 try:
532 return f(self.node.as_const(eval_ctx))
533 except Exception as e:
534 raise Impossible() from e
535
536
537class Name(Expr):

Callers

nothing calls this directly

Calls 4

get_eval_contextFunction · 0.70
ImpossibleClass · 0.70
fFunction · 0.50
as_constMethod · 0.45

Tested by

no test coverage detected