diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-11 12:13:02 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-11 12:13:02 -0800 |
commit | 642eeddcf8f3363de44d85127753e95b6319f059 (patch) | |
tree | eea92700576d92d47dbe96c4fc308da07d1da572 /tools/fix_closure.py | |
parent | 20c28230c1d9a20cd70e0e2ab52a3bacbd2e8db4 (diff) |
tweak fix_closure output
Diffstat (limited to 'tools/fix_closure.py')
-rwxr-xr-x | tools/fix_closure.py | 6 |
1 files changed, 3 insertions, 3 deletions
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() |