Fix a number of outstanding issues:

* {{}} escape their contents, {{{}}} and {{& }} do not
* Add support in the parser, tokenizer and AST for partials
  with context (support is still not there in the runtime)
* Fix some inconsistencies with the old behavior involving
  the correct printing of null and undefined
* Add Handlebars.Exception
* Fixed an issue involving ./foo and this/foo
* Fleshed out helperMissing in the specs (this will be
  moved out into handlebars proper once registerHelper
  and registerPartial are added)
This commit is contained in:
wycats
2010-12-02 01:13:24 -05:00
parent 9846fb8a28
commit 762329913d
11 changed files with 118 additions and 14 deletions
+7 -5
View File
@@ -8,15 +8,17 @@ Handlebars.AST.ProgramNode = function(statements, inverse) {
this.inverse = inverse;
};
Handlebars.AST.MustacheNode = function(params) {
Handlebars.AST.MustacheNode = function(params, unescaped) {
this.type = "mustache";
this.id = params[0];
this.params = params.slice(1);
this.escaped = !unescaped;
};
Handlebars.AST.PartialNode = function(id) {
this.type = "partial";
this.id = id;
Handlebars.AST.PartialNode = function(id, context) {
this.type = "partial";
this.id = id;
this.context = context;
};
Handlebars.AST.BlockNode = function(mustache, program) {
@@ -39,7 +41,7 @@ Handlebars.AST.IdNode = function(parts) {
var part = parts[i];
if(part === "..") { depth++; }
else if(part === "." || part === "this") { break; }
else if(part === "." || part === "this") { continue; }
else { dig.push(part) }
}