MCPcopy Index your code
hub / github.com/nodejs/node / visit_Name

Method visit_Name

tools/inspector_protocol/jinja2/compiler.py:1399–1416  ·  view source on GitHub ↗
(self, node, frame)

Source from the content-addressed store, hash-verified

1397 # -- Expression Visitors
1398
1399 def visit_Name(self, node, frame):
1400 if node.ctx == 'store' and frame.toplevel:
1401 if self._assign_stack:
1402 self._assign_stack[-1].add(node.name)
1403 ref = frame.symbols.ref(node.name)
1404
1405 # If we are looking up a variable we might have to deal with the
1406 # case where it's undefined. We can skip that case if the load
1407 # instruction indicates a parameter which are always defined.
1408 if node.ctx == 'load':
1409 load = frame.symbols.find_load(ref)
1410 if not (load is not None and load[0] == VAR_LOAD_PARAMETER and \
1411 not self.parameter_is_undeclared(ref)):
1412 self.write('(undefined(name=%r) if %s is missing else %s)' %
1413 (node.name, ref, ref))
1414 return
1415
1416 self.write(ref)
1417
1418 def visit_NSRef(self, node, frame):
1419 # NSRefs can only be used to store values; since they use the normal

Callers

nothing calls this directly

Calls 5

writeMethod · 0.95
addMethod · 0.65
refMethod · 0.65
find_loadMethod · 0.45

Tested by

no test coverage detected