summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-09-07 10:58:19 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-09-07 11:15:20 -0400
commit40bd5f736fdf42a7032892eef272d3dfacd2e2a2 (patch)
tree6eb8c79597dccdbd9aa2d834337122db67ef22ad /jstests
parent78d90db28d8341f073361c2df7a35acb17cd8f42 (diff)
downloadmongo-40bd5f736fdf42a7032892eef272d3dfacd2e2a2.tar.gz
SERVER-25895 JS Exceptions can overflow BufBuilder
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/throw_big.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/core/throw_big.js b/jstests/core/throw_big.js
new file mode 100644
index 00000000000..422ee93a6ae
--- /dev/null
+++ b/jstests/core/throw_big.js
@@ -0,0 +1,16 @@
+/**
+ * Test that verifies the javascript integration can handle large string exception messages.
+ */
+(function() {
+ 'use strict';
+
+ var len = 65 * 1024 * 1024;
+ var str = new Array(len + 1).join('b');
+
+ // We expect to successfully throw and catch this large exception message.
+ // We do not want the mongo shell to terminate.
+ assert.throws(function() {
+ throw str;
+ });
+
+})();