Skip to content

Commit 51aff75

Browse files
committed
apply strict mode everywhere
1 parent d15dc31 commit 51aff75

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cwltool/sandboxjs.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def check_js_threshold_version(working_alias):
5656

5757
def new_js_proc(force_docker_pull=False, js_console=False):
5858
# type: (bool, bool) -> subprocess.Popen
59-
59+
6060
cwl_node_engine_js = 'cwlNodeEngine.js'
6161
if js_console:
6262
cwl_node_engine_js = 'cwlNodeEngineJSConsole.js'
@@ -73,7 +73,7 @@ def new_js_proc(force_docker_pull=False, js_console=False):
7373
if subprocess.check_output([n, "--eval", "process.stdout.write('t')"]).decode('utf-8') != "t":
7474
continue
7575
else:
76-
nodejs = subprocess.Popen([n, "--eval", nodecode],
76+
nodejs = subprocess.Popen([n, "--use_strict", "--eval", nodecode],
7777
stdin=subprocess.PIPE,
7878
stdout=subprocess.PIPE,
7979
stderr=subprocess.PIPE)
@@ -104,7 +104,8 @@ def new_js_proc(force_docker_pull=False, js_console=False):
104104
nodejs = subprocess.Popen(["docker", "run",
105105
"--attach=STDIN", "--attach=STDOUT", "--attach=STDERR",
106106
"--sig-proxy=true", "--interactive",
107-
"--rm", nodeimg, "node", "--eval", nodecode],
107+
"--rm", nodeimg, "node", "--use_strict",
108+
"--eval", nodecode],
108109
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
109110
docker = True
110111
except OSError as e:
@@ -166,7 +167,7 @@ def terminate():
166167

167168
PROCESS_FINISHED_STR = "r1cepzbhUTxtykz5XTC4\n"
168169

169-
def process_finished(): # type: () -> bool
170+
def process_finished(): # type: () -> bool
170171
return stdout_buf.getvalue().decode().endswith(PROCESS_FINISHED_STR) and \
171172
stderr_buf.getvalue().decode().endswith(PROCESS_FINISHED_STR)
172173

@@ -235,7 +236,7 @@ def get_error(error_queue):
235236

236237
if nodejs.stderr in rselect:
237238
if not error_queue.empty():
238-
stderr_buf.write(error_queue.get())
239+
stderr_buf.write(error_queue.get())
239240

240241
if process_finished() and error_queue.empty() and output_queue.empty():
241242
finished = True

0 commit comments

Comments
 (0)