aboutsummaryrefslogtreecommitdiff
path: root/tools/js_optimizer.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-24 18:05:40 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:03 -0700
commit54aecffa440170bc9508fc4af5db0e8a866862fa (patch)
tree4b526867567c419cacbadd7123586ebe1c9f1940 /tools/js_optimizer.py
parent5cee70c892ac444f6030e4989755313cc3215569 (diff)
allow extra info in js optimizer, and send relocate pass info that way
Diffstat (limited to 'tools/js_optimizer.py')
-rw-r--r--tools/js_optimizer.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py
index 7cefe90a..8a0464ea 100644
--- a/tools/js_optimizer.py
+++ b/tools/js_optimizer.py
@@ -113,7 +113,7 @@ def run_on_chunk(command):
if DEBUG and not shared.WINDOWS: print >> sys.stderr, '.' # Skip debug progress indicator on Windows, since it doesn't buffer well with multiple threads printing to console.
return filename
-def run_on_js(filename, passes, js_engine, jcache, source_map=False):
+def run_on_js(filename, passes, js_engine, jcache, source_map=False, extra_info=None):
if isinstance(jcache, bool) and jcache: jcache = shared.JCache
if jcache: shared.JCache.ensure()
@@ -251,8 +251,12 @@ EMSCRIPTEN_FUNCS();
f.write(chunk)
f.write(suffix_marker)
if minify_globals:
+ assert not extra_info
f.write('\n')
f.write('// EXTRA_INFO:' + minify_info)
+ elif extra_info:
+ f.write('\n')
+ f.write('// EXTRA_INFO:' + json.dumps(extra_info))
f.close()
return temp_file
filenames = [write_chunk(chunks[i], i) for i in range(len(chunks))]
@@ -331,6 +335,6 @@ EMSCRIPTEN_FUNCS();
return filename
-def run(filename, passes, js_engine, jcache, source_map=False):
- return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache, source_map))
+def run(filename, passes, js_engine, jcache, source_map=False, extra_info=None):
+ return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache, source_map, extra_info))