diff --git a/lib/template.js b/lib/template.js index 14f396d..933276d 100644 --- a/lib/template.js +++ b/lib/template.js @@ -319,6 +319,8 @@ var Hogan = {}; hChars = /[&<>\"\']/; function coerceToString(val) { + if (typeof (val) === 'object' && val !== null && val.toString === Object.prototype.toString) + return (JSON.stringify(val)); return String((val === null || val === undefined) ? '' : val); }