do not wipe out everything after the generated functions suffix; fixes test_embind

This commit is contained in:
Alon Zakai 2013-03-09 16:50:41 -08:00
Родитель 0ecad78d55
Коммит b7093afaf4
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -118,7 +118,8 @@ def run_on_js(filename, passes, js_engine, jcache):
suffix_start = js.find(suffix_marker)
suffix = ''
if suffix_start >= 0:
suffix = js[suffix_start:js.find('\n', suffix_start)] + '\n'
suffix_end = js.find('\n', suffix_start)
suffix = js[suffix_start:suffix_end] + '\n'
# if there is metadata, we will run only on the generated functions. If there isn't, we will run on everything.
generated = set(eval(suffix[len(suffix_marker)+1:]))
@ -178,7 +179,10 @@ EMSCRIPTEN_FUNCS();
#if DEBUG: print >> sys.stderr, 'minify info:', minify_info
# remove suffix if no longer needed
if 'last' in passes:
post = post.split(suffix_marker)[0]
suffix_start = post.find(suffix_marker)
suffix_end = post.find('\n', suffix_start)
post = post[:suffix_start] + post[suffix_end:]
else:
pre = ''
post = ''