瀏覽代碼

Merge commit 'glytch/master'

* commit 'glytch/master':
  tests for null value change
  don't die on null values
tags/0.2.3
Jan Lehnardt 16 年之前
父節點
當前提交
da2df02ede
共有 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 "\\\\";;


Loading…
取消
儲存