@@ -56,7 +56,7 @@ def check_js_threshold_version(working_alias):
56
56
57
57
def new_js_proc (force_docker_pull = False , js_console = False ):
58
58
# type: (bool, bool) -> subprocess.Popen
59
-
59
+
60
60
cwl_node_engine_js = 'cwlNodeEngine.js'
61
61
if js_console :
62
62
cwl_node_engine_js = 'cwlNodeEngineJSConsole.js'
@@ -73,7 +73,7 @@ def new_js_proc(force_docker_pull=False, js_console=False):
73
73
if subprocess .check_output ([n , "--eval" , "process.stdout.write('t')" ]).decode ('utf-8' ) != "t" :
74
74
continue
75
75
else :
76
- nodejs = subprocess .Popen ([n , "--eval" , nodecode ],
76
+ nodejs = subprocess .Popen ([n , "--use_strict" , "-- eval" , nodecode ],
77
77
stdin = subprocess .PIPE ,
78
78
stdout = subprocess .PIPE ,
79
79
stderr = subprocess .PIPE )
@@ -104,7 +104,8 @@ def new_js_proc(force_docker_pull=False, js_console=False):
104
104
nodejs = subprocess .Popen (["docker" , "run" ,
105
105
"--attach=STDIN" , "--attach=STDOUT" , "--attach=STDERR" ,
106
106
"--sig-proxy=true" , "--interactive" ,
107
- "--rm" , nodeimg , "node" , "--eval" , nodecode ],
107
+ "--rm" , nodeimg , "node" , "--use_strict" ,
108
+ "--eval" , nodecode ],
108
109
stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
109
110
docker = True
110
111
except OSError as e :
@@ -166,7 +167,7 @@ def terminate():
166
167
167
168
PROCESS_FINISHED_STR = "r1cepzbhUTxtykz5XTC4\n "
168
169
169
- def process_finished (): # type: () -> bool
170
+ def process_finished (): # type: () -> bool
170
171
return stdout_buf .getvalue ().decode ().endswith (PROCESS_FINISHED_STR ) and \
171
172
stderr_buf .getvalue ().decode ().endswith (PROCESS_FINISHED_STR )
172
173
@@ -235,7 +236,7 @@ def get_error(error_queue):
235
236
236
237
if nodejs .stderr in rselect :
237
238
if not error_queue .empty ():
238
- stderr_buf .write (error_queue .get ())
239
+ stderr_buf .write (error_queue .get ())
239
240
240
241
if process_finished () and error_queue .empty () and output_queue .empty ():
241
242
finished = True
0 commit comments