summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Decker <kpdecker@gmail.com>2013-08-15 08:19:54 -0700
committerKevin Decker <kpdecker@gmail.com>2013-08-15 08:19:54 -0700
commit18506e00c9618c8f1415f35db0a7be37f73f0aa1 (patch)
tree78ee38b05556ea482e6938777556c180bc74ae98
parent860853ddb4ed4cce3a54bbf070bdfb2e07320633 (diff)
parentd02c90c0fbc984523a7a8950e15435938979acbe (diff)
downloadhandlebars.js-18506e00c9618c8f1415f35db0a7be37f73f0aa1.zip
handlebars.js-18506e00c9618c8f1415f35db0a7be37f73f0aa1.tar.gz
handlebars.js-18506e00c9618c8f1415f35db0a7be37f73f0aa1.tar.bz2
Merge pull request #535 from sorentwo/alternate-string-coercion
Use the String(string) form of string coercion
-rw-r--r--lib/handlebars/utils.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js
index 1e0e4c9..e104dcf 100644
--- a/lib/handlebars/utils.js
+++ b/lib/handlebars/utils.js
@@ -21,7 +21,7 @@ Handlebars.SafeString = function(string) {
this.string = string;
};
Handlebars.SafeString.prototype.toString = function() {
- return this.string.toString();
+ return "" + this.string;
};
var escape = {
@@ -60,7 +60,7 @@ Handlebars.Utils = {
// Force a string conversion as this will be done by the append regardless and
// the regex test will do this transparently behind the scenes, causing issues if
// an object's to string has escaped characters in it.
- string = string.toString();
+ string = "" + string;
if(!possible.test(string)) { return string; }
return string.replace(badChars, escapeChar);