File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1142,6 +1142,16 @@ try:
11421142 execute (shlex .split (js_transform , posix = posix ) + [os .path .abspath (final )])
11431143 if DEBUG : save_intermediate ('transformed' )
11441144
1145+ if shared .Settings .ASM_JS : # XXX temporary wrapping for testing purposes
1146+ unwrapped = open (final ).read ()
1147+ final += '.asmwrap.js'
1148+ open (final , 'w' ).write ('''
1149+ (function() { // prevent new Function from seeing the global scope
1150+ %s
1151+ }).apply(null, arguments);
1152+ ''' % unwrapped )
1153+ if DEBUG : save_intermediate ('asmwrap' )
1154+
11451155 # It is useful to run several js optimizer passes together, to save on unneeded unparsing/reparsing
11461156 js_optimizer_queue = []
11471157 def flush_js_optimizer_queue ():
Original file line number Diff line number Diff line change @@ -267,9 +267,6 @@ def indexize(js):
267267 def blockaddrsize (js ):
268268 return re .sub (r'{{{ BA_([\w\d_$]+)\|([\w\d_$]+) }}}' , lambda m : str (blockaddrs [m .groups (0 )[0 ]][m .groups (0 )[1 ]]), js )
269269
270- if settings .get ('ASM_JS' ):
271- outfile .write ('(function() {\n ' ); # prevent new Function from seeing the global scope
272-
273270 #if DEBUG: outfile.write('// pre\n')
274271 outfile .write (blockaddrsize (indexize (pre )))
275272 pre = None
@@ -388,9 +385,6 @@ def blockaddrsize(js):
388385 outfile .write (indexize (post ))
389386 if DEBUG : print >> sys .stderr , ' emscript: phase 3 took %s seconds' % (time .time () - t )
390387
391- if settings .get ('ASM_JS' ):
392- outfile .write ('}).apply(null, arguments);\n ' );
393-
394388 outfile .close ()
395389
396390
You can’t perform that action at this time.
0 commit comments