diff --git a/mustache.js b/mustache.js index a242c1c..24b1c19 100644 --- a/mustache.js +++ b/mustache.js @@ -38,8 +38,14 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {}; var curlyRe = /\s*\}/; var tagRe = /#|\^|\/|>|\{|&|=|!/; + // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577 + // See https://github.com/janl/mustache.js/issues/189 + function testRe(re, string) { + return RegExp.prototype.test.call(re, string); + } + function isWhitespace(string) { - return !nonSpaceRe.test(string); + return !testRe(nonSpaceRe, string); } var isArray = Array.isArray || function (obj) {