Got rid of some debugging output.
This commit is contained in:
@@ -125,7 +125,6 @@ Handlebars.Compiler.prototype = {
|
||||
var parsed = Handlebars.parsePath(param);
|
||||
var depth = parsed[0];
|
||||
var parts = parsed[1];
|
||||
console.log(depth)
|
||||
|
||||
var paramExpr = "";
|
||||
for(var i = 0; i < parts.length; i++) {
|
||||
@@ -133,10 +132,8 @@ Handlebars.Compiler.prototype = {
|
||||
}
|
||||
|
||||
if (depth > 0) {
|
||||
console.log(depth + ", " + paramExpr);
|
||||
return "( stack[stack.length - " + depth + "]" + paramExpr + ")";
|
||||
} else {
|
||||
console.log(paramExpr);
|
||||
return "( context" + paramExpr + " || fallback " + paramExpr + " )";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -26,6 +26,11 @@ test("boolean", function() {
|
||||
"booleans do not show the contents when false");
|
||||
});
|
||||
|
||||
test("functions", function() {
|
||||
shouldCompileTo("{{awesome}}", {awesome: function() { return "Awesome"; }}, "Awesome",
|
||||
"functions are called and render their output");
|
||||
});
|
||||
|
||||
test("nested paths", function() {
|
||||
shouldCompileTo("Goodbye {{alan/expression}} world!", {alan: {expression: "beautiful"}},
|
||||
"Goodbye beautiful world!", "Nested paths access nested objects");
|
||||
|
||||
Reference in New Issue
Block a user