Permalink
Browse files

Less code per line, fix Rhino compat.

  • Loading branch information...
1 parent 86ed681 commit 2bab7be637da89f489518e7d219e13b754ae783e @janl janl committed May 22, 2010
Showing with 4 additions and 1 deletion.
  1. +1 −0 CHANGES.md
  2. +1 −0 THANKS.md
  3. +2 −1 mustache.js
View
@@ -2,6 +2,7 @@
## 0.3.0 (??-??-????)
+* Fix Rhino compat.
* CommonJS packaging is no longer a special case.
* DRY Rakefile.
* Allow whitespace around tag names.
View
@@ -17,3 +17,4 @@ Mustache.js wouldn't kick ass if it weren't for these fine souls:
* dpree
* Jason Smith / jhs
* Aaron Gibralter / agibralter
+ * Ross Boucher / boucher
View
@@ -240,7 +240,8 @@ var Mustache = function() {
Does away with nasty characters
*/
escape: function(s) {
- return ((s == null) ? "" : s).toString().replace(/&(?!\w+;)|["<>\\]/g, function(s) {
+ s = String(s == null ? "" : s);
+ return s.replace(/&(?!\w+;)|["<>\\]/g, function(s) {
switch(s) {
case "&": return "&amp;";
case "\\": return "\\\\";;

0 comments on commit 2bab7be

Please sign in to comment.