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

Method as_const

tools/inspector_protocol/jinja2/nodes.py:590–599  ·  view source on GitHub ↗
(self, eval_ctx=None)

Source from the content-addressed store, hash-verified

588 fields = ('test', 'expr1', 'expr2')
589
590 def as_const(self, eval_ctx=None):
591 eval_ctx = get_eval_context(self, eval_ctx)
592 if self.test.as_const(eval_ctx):
593 return self.expr1.as_const(eval_ctx)
594
595 # if we evaluate to an undefined object, we better do that at runtime
596 if self.expr2 is None:
597 raise Impossible()
598
599 return self.expr2.as_const(eval_ctx)
600
601
602def args_as_const(node, eval_ctx):

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