diff options
Diffstat (limited to 'src/mongo/shell/assert.js')
-rw-r--r-- | src/mongo/shell/assert.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/shell/assert.js b/src/mongo/shell/assert.js index 21474fd657f..4e6b762475a 100644 --- a/src/mongo/shell/assert.js +++ b/src/mongo/shell/assert.js @@ -97,6 +97,8 @@ assert = (function() { function _processMsg(msg) { if (typeof msg === "function") { return msg(); + } else if (typeof msg === "object") { + return tojson(msg); } return msg; @@ -108,8 +110,8 @@ assert = (function() { if (msg.length !== 0) { doassert("msg function cannot expect any parameters."); } - } else if (typeof msg !== "string") { - doassert("msg parameter must be a string or a function."); + } else if (typeof msg !== "string" && typeof msg !== "object") { + doassert("msg parameter must be a string, function or object."); } if (msg && assert._debug) { |