Bug 1283710 - Part 8: Do not duplicate zero arguments error message. r=jwalden
☠☠ backed out by 971d67779565 ☠ ☠
authorTooru Fujisawa <arai_a@mac.com>
Wed, 19 Oct 2016 02:10:33 +0900
changeset 318512 fed60fbf645df22d963397aa96c0a926005d2086
parent 318511 98339fa564f1b5ba8e0c518a0ff476447bcbf1d3
child 318513 f727edc4be4805fb275be192145f0a5902477589
push id20725
push userphilringnalda@gmail.com
push dateThu, 20 Oct 2016 01:36:01 +0000
treeherderfx-team@998ad5a74da8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1283710
milestone52.0a1
Bug 1283710 - Part 8: Do not duplicate zero arguments error message. r=jwalden
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -646,22 +646,18 @@ js::ExpandErrorArgumentsVA(ExclusiveCont
             }
         } else {
             /* Non-null messageArgs should have at least one non-null arg. */
             MOZ_ASSERT(!messageArgs);
             /*
              * Zero arguments: the format string (if it exists) is the
              * entire message.
              */
-            if (efs->format) {
-                char* message = DuplicateString(cx, efs->format).release();
-                if (!message)
-                    return false;
-                reportp->initOwnedMessage(message);
-            }
+            if (efs->format)
+                reportp->initBorrowedMessage(efs->format);
         }
     }
     if (!reportp->message()) {
         /* where's the right place for this ??? */
         const char* defaultErrorMessage
             = "No error message available for error number %d";
         size_t nbytes = strlen(defaultErrorMessage) + 16;
         char* message = cx->pod_malloc<char>(nbytes);