aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/runner.py2
-rwxr-xr-xtools/fix_closure.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py
index df833b24..18ce11af 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -5473,7 +5473,7 @@ f.close()
expected = path_from_root('tests', 'test-fix-closure.out.js')
Popen(['python', path_from_root('tools', 'fix_closure.py'), input, 'out.js']).communicate(input)
output = open('out.js').read()
- assert '0,uninline_Q_14782,0' in output
+ assert '0,zzz_Q_39fa,0' in output
assert 'function(a,c)' not in output # should be uninlined, so it gets a name
assert run_js(input) == run_js('out.js')
diff --git a/tools/fix_closure.py b/tools/fix_closure.py
index 5237c7b1..ab2dacbc 100755
--- a/tools/fix_closure.py
+++ b/tools/fix_closure.py
@@ -71,9 +71,9 @@ while True:
text = line[curr:next]
#print 'zz func!', text
assert text.startswith('function(')
- ident = 'uninline_' + target + '_' + str(curr) # these idents should be unique, but might in theory collide with the rest of the JS code! XXX
+ ident = 'zzz_' + target + '_' + hex(curr)[2:] # these idents should be unique, but might in theory collide with the rest of the JS code! XXX
line = line[:curr] + ident + line[next:]
- add += 'function ' + ident + '(' + text[len('function('):]
+ add += 'function ' + ident + '(' + text[len('function('):] + '\n'
#print 'zz after func fix:', line[curr:curr+100]
while line[curr] != ',' and line[curr] != ']':
curr += 1
@@ -81,7 +81,7 @@ while True:
curr += 1
assert line[curr] == ';', 'odd char: ' + str([line[curr], line[curr-10:curr+10]])
curr += 1
- line = line[:curr] + ''.join(add) + line[curr:]
+ line = line[:curr] + '\n' + ''.join(add) + line[curr:]
outfile.write(line)
outfile.close()