Bug 1351607 - pass -e expressions to the JS shell as separate command line arguments. r=sfink
authorLars T Hansen <lhansen@mozilla.com>
Wed, 29 Mar 2017 13:37:58 +0200
changeset 398579 8687e282be2e481d626883ef9adab2c41143a24b
parent 398578 80bea9982b5f26d894bb04372378b08616c0ae6b
child 398580 7106e4c7c7d1031f817f55523023818b29241f50
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1351607
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1351607 - pass -e expressions to the JS shell as separate command line arguments. r=sfink
js/src/tests/lib/jittests.py
--- a/js/src/tests/lib/jittests.py
+++ b/js/src/tests/lib/jittests.py
@@ -295,28 +295,32 @@ class JitTest:
         # Platforms where subprocess immediately invokes exec do not care
         # whether we use double or single quotes. On windows and when using
         # a remote device, however, we have to be careful to use the quote
         # style that is the opposite of what the exec wrapper uses.
         if remote_prefix:
             quotechar = '"'
         else:
             quotechar = "'"
-        expr = "const platform={}; const libdir={}; const scriptdir={}".format(
-            js_quote(quotechar, sys.platform),
-            js_quote(quotechar, libdir),
-            js_quote(quotechar, scriptdir_var))
+
+        # Don't merge the expressions: We want separate -e arguments to avoid
+        # semicolons in the command line, bug 1351607.
+        exprs = ["const platform={}".format(js_quote(quotechar, sys.platform)),
+                 "const libdir={}".format(js_quote(quotechar, libdir)),
+                 "const scriptdir={}".format(js_quote(quotechar, scriptdir_var))];
 
         if self.need_for_each:
-            expr += "; enableForEach()"
+            exprs += ["enableForEach()"]
 
         # We may have specified '-a' or '-d' twice: once via --jitflags, once
         # via the "|jit-test|" line.  Remove dups because they are toggles.
         cmd = prefix + ['--js-cache', JitTest.CacheDir]
-        cmd += list(set(self.jitflags)) + ['-e', expr]
+        cmd += list(set(self.jitflags))
+        for expr in exprs:
+            cmd += ['-e', expr]
         for inc in self.other_includes:
             cmd += ['-f', libdir + inc]
         if self.is_module:
             cmd += ['--module-load-path', moduledir]
             cmd += ['--module', path]
         elif self.test_reflect_stringify is None:
             cmd += ['-f', path]
         else: