Skip to content

Commit 5e24adb

Browse files
bnoordhuisindutny
authored andcommitted
deps: fix up v8 postmortem codegen
Fix up overzealous parses, strip whitespace from class and field names.
1 parent 67e0780 commit 5e24adb

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

deps/v8/tools/gen-postmortem-metadata.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,13 @@ def load_fields():
434434
# Emit a block of constants.
435435
#
436436
def emit_set(out, consts):
437-
for ii in range(0, len(consts)):
438-
out.write('int v8dbg_%s = %s;\n' %
439-
(consts[ii]['name'], consts[ii]['value']));
437+
# Fix up overzealous parses. This could be done inside the
438+
# parsers but as there are several, it's easiest to do it here.
439+
ws = re.compile('\s+')
440+
for const in consts:
441+
name = ws.sub('', const['name'])
442+
value = ws.sub('', str(const['value'])) # Can be a number.
443+
out.write('int v8dbg_%s = %s;\n' % (name, value))
440444
out.write('\n');
441445

442446
#

0 commit comments

Comments
 (0)