Bläddra i källkod

tests for null value change

tags/0.2.3
Elise Wood 16 år sedan
förälder
incheckning
6324de20c6
4 ändrade filer med 20 tillägg och 1 borttagningar
  1. +5
    -0
      examples/null_string.html
  2. +9
    -0
      examples/null_string.js
  3. +5
    -0
      examples/null_string.txt
  4. +1
    -1
      mustache.js

+ 5
- 0
examples/null_string.html Visa fil

@@ -0,0 +1,5 @@
Hello {{name}}
glytch {{glytch}}
binary {{binary}}
value {{value}}
numeric {{numeric}}

+ 9
- 0
examples/null_string.js Visa fil

@@ -0,0 +1,9 @@
var null_string = {
name: "Elise",
glytch: true,
binary: false,
value: null,
numeric: function() {
return NaN;
}
};

+ 5
- 0
examples/null_string.txt Visa fil

@@ -0,0 +1,5 @@
Hello Elise
glytch true
binary false
value
numeric NaN

+ 1
- 1
mustache.js Visa fil

@@ -194,7 +194,7 @@ var Mustache = function() {
Does away with nasty characters Does away with nasty characters
*/ */
escape: function(s) { escape: function(s) {
return (s ? s.toString() : "").replace(/[&"<>\\]/g, function(s) {
return ((s == null) ? "" : s).toString().replace(/[&"<>\\]/g, function(s) {
switch(s) { switch(s) {
case "&": return "&amp;"; case "&": return "&amp;";
case "\\": return "\\\\";; case "\\": return "\\\\";;


Laddar…
Avbryt
Spara