소스 검색

mustache compat: Don't barf on unknown variables.

tags/0.2
Jan Lehnardt 16 년 전
부모
커밋
0bb4776def
3개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. +1
    -1
      examples/error_not_found.txt
  2. +2
    -1
      mustache.js
  3. +1
    -1
      test/mustache_spec.rb

+ 1
- 1
examples/error_not_found.txt 파일 보기

@@ -1 +1 @@
ERROR: 'foo' not found in context

+ 2
- 1
mustache.js 파일 보기

@@ -158,7 +158,8 @@ var Mustache = function() {
if(context[name] !== undefined) {
return context[name];
}
throw({message: "'" + name + "' not found in context"});
// silently ignore unkown variables
return "";
},

// Utility methods


+ 1
- 1
test/mustache_spec.rb 파일 보기

@@ -37,7 +37,7 @@ describe "mustache" do
print('ERROR: ' + e.message);
}
JS
run_js(js).should == "ERROR: 'x' not found in context\n"
run_js(js).should == "\n"
end
non_partials.each do |testname|


불러오는 중...
취소
저장