@@ -27,7 +27,7 @@ def timeout_run(proc, timeout=None, note='unnamed process', full_output=False, n
2727 return '\n ' .join (out ) if full_output else out [0 ]
2828
2929
30- def make_command (filename , engine = None , args = []):
30+ def make_command (filename , engine = None , args = [], shell_args = [] ):
3131 if type (engine ) is not list :
3232 engine = [engine ]
3333 # Emscripten supports multiple javascript runtimes. The default is nodejs but
@@ -43,10 +43,12 @@ def make_command(filename, engine=None, args=[]):
4343 is_d8 = 'd8' in jsengine
4444 # Disable true async compilation (async apis will in fact be synchronous) for now
4545 # due to https://bugs.chromium.org/p/v8/issues/detail?id=6263
46- shell_option_flags = ['--no-wasm-async-compilation' ] if is_d8 else []
46+ shell_args . extend ( ['--no-wasm-async-compilation' ] if is_d8 else [])
4747 # Separates engine flags from script flags
48- flag_separator = ['--' ] if is_d8 or 'jsc' in jsengine else []
49- return engine + [filename ] + shell_option_flags + flag_separator + args
48+ if is_d8 or 'jsc' in jsengine :
49+ return engine + [filename ] + shell_args + ['--' ] + args
50+ else :
51+ return engine + shell_args + [filename ] + args
5052
5153
5254def check_engine (engine ):
@@ -87,7 +89,7 @@ def run_js_tool(filename, engine, jsargs=[], *args, **kw):
8789
8890
8991# TODO(sbc): Move to into test directory
90- def run_js (filename , engine = None , args = [], check_timeout = False , stdin = None , stdout = PIPE , stderr = None , cwd = None ,
92+ def run_js (filename , engine = None , args = [], shell_args = [], check_timeout = False , stdin = None , stdout = PIPE , stderr = None , cwd = None ,
9193 full_output = False , assert_returncode = 0 , error_limit = - 1 , skip_check = False ):
9294 """Execute javascript code generated by tests, with possible timeout."""
9395 if not os .path .exists (filename ):
@@ -112,7 +114,7 @@ def run_js(filename, engine=None, args=[], check_timeout=False, stdin=None, stdo
112114 # commands += os.path.basename(curr) + ',' + json.dumps(args) + '\n'
113115 # open(commands_file, 'w').write(commands)
114116
115- command = make_command (filename , engine , args )
117+ command = make_command (filename , engine , args , shell_args )
116118 try :
117119 proc = Popen (
118120 command ,
0 commit comments