ソースを参照

don't barf on undefined partial contexts, return the verbatim partial instead

tags/0.2.3
Jan Lehnardt 16年前
コミット
4694868fdc
6個のファイルの変更12行の追加3行の削除
  1. +1
    -0
      CHANGES.md
  2. +1
    -0
      examples/empty_partial.2.html
  3. +2
    -0
      examples/empty_partial.html
  4. +3
    -0
      examples/empty_partial.js
  5. +2
    -0
      examples/empty_partial.txt
  6. +3
    -3
      mustache.js

+ 1
- 0
CHANGES.md ファイルの表示

@@ -6,6 +6,7 @@
* Added more robust type detection.
* Parse pragmas only once.
* Throw exception when encountering an unknown pragma.
* Ignore undefined partial contexts. Returns verbatim partials.


## 0.2.2 (11-02-2010)


+ 1
- 0
examples/empty_partial.2.html ファイルの表示

@@ -0,0 +1 @@
yo

+ 2
- 0
examples/empty_partial.html ファイルの表示

@@ -0,0 +1,2 @@
hey {{foo}}
{{>partial}}

+ 3
- 0
examples/empty_partial.js ファイルの表示

@@ -0,0 +1,3 @@
var partial_context = {
foo: 1
};

+ 2
- 0
examples/empty_partial.txt ファイルの表示

@@ -0,0 +1,2 @@
hey 1
yo

+ 3
- 3
mustache.js ファイルの表示

@@ -85,12 +85,12 @@ var Mustache = function() {
Tries to find a partial in the global scope and render it
*/
render_partial: function(name, context, partials) {
if(typeof(context[name]) != "object") {
throw({message: "subcontext for '" + name + "' is not an object"});
}
if(!partials || !partials[name]) {
throw({message: "unknown_partial '" + name + "'"});
}
if(typeof(context[name]) != "object") {
return partials[name];
}
return this.render(partials[name], context[name], partials, true);
},



読み込み中…
キャンセル
保存