blob: 45420e0f0a72538dd1fdcc5c471eeb6bb021d92d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# Run, then execute
'''
dump(JSON.stringify(usedFunctions))
'''
# then strip with profile_strip.py
import sys
print 'var usedFunctions = {};'
for line in open(sys.argv[1]).readlines():
line = line.strip()
print line
if line.startswith('function _') and line.endswith(('){', ') {')):
name = line.split(' ')[1].split('(')[0]
print 'usedFunctions["%s"] = 1;' % name
|