Просмотр исходного кода

tests for null value change

tags/0.2.3
Elise Wood 16 лет назад
Родитель
Сommit
6324de20c6
4 измененных файлов: 20 добавлений и 1 удалений
  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 Просмотреть файл

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

+ 9
- 0
examples/null_string.js Просмотреть файл

@@ -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 Просмотреть файл

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

+ 1
- 1
mustache.js Просмотреть файл

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


Загрузка…
Отмена
Сохранить