diff --git a/mustache.js b/mustache.js index 93d20d6d9..af48fd1c5 100644 --- a/mustache.js +++ b/mustache.js @@ -32,10 +32,13 @@ var curlyRe = /\s*\}/; var tagRe = /#|\^|\/|>|\{|&|=|!/; + var _test = RegExp.prototype.test; + var _toString = Object.prototype.toString; + // 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); + return _test.call(re, string); } function isWhitespace(string) { @@ -43,7 +46,7 @@ } var isArray = Array.isArray || function (obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; + return _toString.call(obj) === '[object Array]'; }; function escapeRe(string) {