bug 1492499: marionette: trim crlf off produced stack; r=automatedtester
authorAndreas Tolfsen <ato@sny.no>
Thu, 11 Oct 2018 16:40:08 +0000
changeset 443620 0e4677eff22b0e4baa9968cd3b2be54cf2a668ab
parent 443619 246b45eae45c12e0755be1665208309d2e9f4b6f
child 443621 9ca2c179e63e292808918158eb778b16bf18e67f
push id109420
push useraciure@mozilla.com
push dateWed, 31 Oct 2018 05:11:56 +0000
treeherdermozilla-inbound@b357da105c49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1492499
milestone65.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 1492499: marionette: trim crlf off produced stack; r=automatedtester The stack is joined with "\n" causing an extra carriage return line feed to appear at the end of the string. Depends on D8405 Differential Revision: https://phabricator.services.mozilla.com/D8406
testing/marionette/error.js
--- a/testing/marionette/error.js
+++ b/testing/marionette/error.js
@@ -155,17 +155,18 @@ error.stringify = function(err) {
   }
 };
 
 /** Create a stacktrace to the current line in the program. */
 this.stack = function() {
   let trace = new Error().stack;
   let sa = trace.split("\n");
   sa = sa.slice(1);
-  return "stacktrace:\n" + sa.join("\n");
+  let rv = "stacktrace:\n" + sa.join("\n");
+  return rv.trimEnd();
 };
 
 /**
  * WebDriverError is the prototypal parent of all WebDriver errors.
  * It should not be used directly, as it does not correspond to a real
  * error in the specification.
  */
 class WebDriverError extends Error {