Bug 1527482 - Check for BigInts in ValueToSourceForError r=arai
authorRobin Templeton <robin@igalia.com>
Tue, 12 Feb 2019 23:21:53 +0000
changeset 458828 b52799e37195
parent 458827 a2e4d687840d
child 458829 ba745ab8ec4a
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1527482
milestone67.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 1527482 - Check for BigInts in ValueToSourceForError r=arai Differential Revision: https://phabricator.services.mozilla.com/D19590
js/src/jsexn.cpp
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -1063,17 +1063,25 @@ const char* js::ValueToSourceForError(JS
   } else if (val.isNumber()) {
     if (!sb.append("the number ")) {
       return "<<error converting value to string>>";
     }
   } else if (val.isString()) {
     if (!sb.append("the string ")) {
       return "<<error converting value to string>>";
     }
-  } else {
+  }
+#ifdef ENABLE_BIGINT
+  else if (val.isBigInt()) {
+    if (!sb.append("the BigInt ")) {
+      return "<<error converting value to string>>";
+    }
+  }
+#endif
+  else {
     MOZ_ASSERT(val.isBoolean() || val.isSymbol());
     bytes = StringToNewUTF8CharsZ(cx, *str);
     return bytes.get();
   }
   if (!sb.append(str)) {
     return "<<error converting value to string>>";
   }
   str = sb.finishString();