Got rid of some debugging output.

This commit is contained in:
Alan Johnson
2010-08-05 23:41:24 -04:00
parent 21d779bb54
commit 03d06fa70a
2 changed files with 5 additions and 3 deletions
-3
View File
@@ -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 + " )";
}
},
+5
View File
@@ -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");