Bug 1497686 - Better error message when a jsapi-test fails with an exception pending. r=jwalden
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 10 Oct 2018 17:47:54 +0000
changeset 499044 2c21c87e773ee1bfd796079fe5ffe06c2057b9ae
parent 499043 71160e8bcfb743129388fa3d3948a8d036263785
child 499045 81dd098adbd8984f9491eae22dac152cf4fb2d71
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1497686
milestone64.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 1497686 - Better error message when a jsapi-test fails with an exception pending. r=jwalden Differential Revision: https://phabricator.services.mozilla.com/D8154
js/src/jsapi-tests/tests.h
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -223,16 +223,18 @@ class JSAPITest
     {
         char location[256];
         snprintf(location, mozilla::ArrayLength(location), "%s:%d:", filename, lineno);
 
         JSAPITestString message(location);
         message += msg;
 
         if (JS_IsExceptionPending(cx)) {
+            message += " -- ";
+
             js::gc::AutoSuppressGC gcoff(cx);
             JS::RootedValue v(cx);
             JS_GetPendingException(cx, &v);
             JS_ClearPendingException(cx);
             JSString* s = JS::ToString(cx, v);
             if (s) {
                 if (JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, s)) {
                     message += bytes.get();