summaryrefslogtreecommitdiff
path: root/js/src/vm/StringBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/StringBuffer.cpp')
-rw-r--r--js/src/vm/StringBuffer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/src/vm/StringBuffer.cpp b/js/src/vm/StringBuffer.cpp
index e4f0e4f4d6..ce0fc4e719 100644
--- a/js/src/vm/StringBuffer.cpp
+++ b/js/src/vm/StringBuffer.cpp
@@ -170,6 +170,13 @@ js::ValueToStringBufferSlow(JSContext* cx, const Value& arg, StringBuffer& sb)
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_SYMBOL_TO_STRING);
return false;
}
+ if (v.isBigInt()) {
+ RootedBigInt i(cx, v.toBigInt());
+ JSLinearString* str = BigInt::toString(cx, i, 10);
+ if (!str)
+ return false;
+ return sb.append(str);
+ }
MOZ_ASSERT(v.isUndefined());
return sb.append(cx->names().undefined);
}