Bug 1455176: Prefer stack from the rejection reason object to the rejection stack. r=aswan
authorKris Maglione <maglione.k@gmail.com>
Wed, 18 Apr 2018 18:18:50 -0700
changeset 468230 632f2133a45c3e0c0f8f342bba1596a0dae872bb
parent 468229 50568caaf2f8d3542429cff876c4ad200b60ff09
child 468231 dad590c53eb70211d3704c49c578c9b3bfbbdc6f
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1455176
milestone61.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 1455176: Prefer stack from the rejection reason object to the rejection stack. r=aswan MozReview-Commit-ID: 9iYhUBdifm5
toolkit/modules/tests/modules/PromiseTestUtils.jsm
--- a/toolkit/modules/tests/modules/PromiseTestUtils.jsm
+++ b/toolkit/modules/tests/modules/PromiseTestUtils.jsm
@@ -145,18 +145,18 @@ var PromiseTestUtils = {
     // We should convert the rejection stack to a string immediately. This is
     // because the object might not be available when we report the rejection
     // later, if the error occurred in a context that has been unloaded.
     let stack = "(Unable to convert rejection stack to string.)";
     try {
       // In some cases, the rejection stack from `PromiseDebugging` may be null.
       // If the rejection reason was an Error object, use its `stack` to recover
       // a meaningful value.
-      stack = "" + (PromiseDebugging.getRejectionStack(promise) ||
-                    (reason && reason.stack) ||
+      stack = "" + ((reason && reason.stack) ||
+                    PromiseDebugging.getRejectionStack(promise) ||
                     "(No stack available.)");
     } catch (ex) {}
 
     // Always add a newline at the end of the stack for consistent reporting.
     // This is already present when the stack is provided by PromiseDebugging.
     if (!stack.endsWith("\n")) {
       stack += "\n";
     }