@@ -2031,11 +2031,8 @@ def js_optimizer(filename, passes, debug=False, extra_info=None, output_filename
2031
2031
2032
2032
# run JS optimizer on some JS, ignoring asm.js contents if any - just run on it all
2033
2033
@staticmethod
2034
- def js_optimizer_no_asmjs (filename , passes , return_output = False , extra_info = None , acorn = False ):
2035
- if not acorn :
2036
- optimizer = path_from_root ('tools' , 'js-optimizer.js' )
2037
- else :
2038
- optimizer = path_from_root ('tools' , 'acorn-optimizer.js' )
2034
+ def acorn_optimizer (filename , passes , extra_info = None , return_output = False ):
2035
+ optimizer = path_from_root ('tools' , 'acorn-optimizer.js' )
2039
2036
original_filename = filename
2040
2037
if extra_info is not None :
2041
2038
temp_files = configuration .get_temp_files ()
@@ -2047,22 +2044,17 @@ def js_optimizer_no_asmjs(filename, passes, return_output=False, extra_info=None
2047
2044
cmd = NODE_JS + [optimizer , filename ] + passes
2048
2045
# Keep JS code comments intact through the acorn optimization pass so that JSDoc comments
2049
2046
# will be carried over to a later Closure run.
2050
- if acorn and Settings .USE_CLOSURE_COMPILER :
2047
+ if Settings .USE_CLOSURE_COMPILER :
2051
2048
cmd += ['--closureFriendly' ]
2052
2049
if not return_output :
2053
2050
next = original_filename + '.jso.js'
2054
2051
configuration .get_temp_files ().note (next )
2055
2052
check_call (cmd , stdout = open (next , 'w' ))
2056
2053
next = Building .maybe_add_license (filename = next )
2057
2054
return next
2058
- else :
2059
- output = check_call (cmd , stdout = PIPE ).stdout
2060
- output = Building .maybe_add_license (code = output )
2061
- return output
2062
-
2063
- @staticmethod
2064
- def acorn_optimizer (filename , passes , extra_info = None , return_output = False ):
2065
- return Building .js_optimizer_no_asmjs (filename , passes , extra_info = extra_info , return_output = return_output , acorn = True )
2055
+ output = check_call (cmd , stdout = PIPE ).stdout
2056
+ output = Building .maybe_add_license (code = output )
2057
+ return output
2066
2058
2067
2059
# evals ctors. if binaryen_bin is provided, it is the dir of the binaryen tool for this, and we are in wasm mode
2068
2060
@staticmethod
0 commit comments