aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-09 20:01:14 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-03-09 20:01:14 -0800
commit0f538ae57bb65af11efb7372661ba7c929c98d61 (patch)
tree091e8ed588207b317af07455bac65654b183245a /emcc
parent5c5a9dd4bf35d95ffe83e655fe2a237241f0a96a (diff)
parent4794e95b9ba2ab9104d6da7b0a6c7bf31c2f812a (diff)
Merge branch 'asm_minifier' into incoming
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc21
1 files changed, 9 insertions, 12 deletions
diff --git a/emcc b/emcc
index ca23adf0..1acd3aff 100755
--- a/emcc
+++ b/emcc
@@ -332,13 +332,11 @@ Options that are modified or new in %s include:
output HTML but with suffix .data.compress
--minify <on> 0: Do not minify the generated JavaScript's
- whitespace (default if closure compiler
- will not be run)
+ whitespace (default in -O0, -O1, or if
+ -g is used)
1: Minify the generated JavaScript's
- whitespace (default if closure compiler
- will be run). Note that this by itself
- will not minify the code (closure does
- that)
+ whitespace (default in -O2+, assuming
+ -g is not used)
--split <size> Splits the resulting javascript file into pieces
to ease debugging. This option only works if
@@ -983,7 +981,7 @@ try:
closure = False
if minify_whitespace is None:
- minify_whitespace = closure # if closure is run, minify whitespace
+ minify_whitespace = opt_level >= 2 and not keep_js_debug
## Compile source code to bitcode
@@ -1367,11 +1365,10 @@ try:
flush_js_optimizer_queue()
- if not minify_whitespace:
- # Remove some trivial whitespace
- src = open(final).read()
- src = re.sub(r'\n+[ \n]*\n+', '\n', src)
- open(final, 'w').write(src)
+ # Remove some trivial whitespace # TODO: do not run when compress has already been done on all parts of the code
+ src = open(final).read()
+ src = re.sub(r'\n+[ \n]*\n+', '\n', src)
+ open(final, 'w').write(src)
# If we were asked to also generate HTML, do that
if final_suffix == 'html':