From 03d06fa70a37308dfbfb0980524f93d63549ead3 Mon Sep 17 00:00:00 2001 From: Alan Johnson Date: Thu, 5 Aug 2010 23:41:24 -0400 Subject: [PATCH] Got rid of some debugging output. --- lib/handlebars.js | 3 --- test/handlebars.js | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) 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");