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

Function emit_constants

deps/v8/tools/gen-postmortem-metadata.py:941–954  ·  view source on GitHub ↗
(out, consts)

Source from the content-addressed store, hash-verified

939# Emit a block of constants.
940#
941def emit_constants(out, consts):
942 lines = []
943
944 # Fix up overzealous parses. This could be done inside the
945 # parsers but as there are several, it's easiest to do it here.
946 ws = re.compile(r'\s+')
947 for const in consts:
948 name = ws.sub('', const['name'])
949 value = ws.sub('', str(const['value'])) # Can be a number.
950 lines.append('V8_EXPORT int v8dbg_%s = %s;' % (name, value))
951
952 # Generate without duplicates and with preserved order.
953 out.write('\n'.join(dict.fromkeys(lines)))
954 out.write('\n');
955
956#
957# Emit the whole output file.

Callers 1

emit_configFunction · 0.85

Calls 5

strFunction · 0.85
compileMethod · 0.45
appendMethod · 0.45
writeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected