diff --git a/lib/handlebars.js b/lib/handlebars.js index b4f3654c..2cde0ce2 100644 --- a/lib/handlebars.js +++ b/lib/handlebars.js @@ -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 + " )"; } }, diff --git a/test/handlebars.js b/test/handlebars.js index 15c231c6..9fcc0d6b 100644 --- a/test/handlebars.js +++ b/test/handlebars.js @@ -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");