From e9fe73d7ab71b069245ee521cbf077d85e386373 Mon Sep 17 00:00:00 2001 From: Andrey Lushchick Date: Thu, 27 Dec 2012 14:10:23 +0200 Subject: [PATCH 1/3] Removed unnecessary semicolon, which is needed to pass JSHint for compiled code --- lib/handlebars/compiler/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 297a5534..64ae959f 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -805,7 +805,7 @@ Handlebars.JavaScriptCompiler = function() {}; } this.context.aliases.self = "this"; - this.pushStack("self.invokePartial(" + params.join(", ") + ");"); + this.pushStack("self.invokePartial(" + params.join(", ") + ")"); }, // [assignToHash] From ca22ca57e1d8b4d6ace2e603780ceaf849ac04bf Mon Sep 17 00:00:00 2001 From: Paul Banks Date: Sun, 30 Dec 2012 17:23:11 +0000 Subject: [PATCH 2/3] Fix typo in readme example --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 28fa9a56..c3f05014 100644 --- a/README.markdown +++ b/README.markdown @@ -139,7 +139,7 @@ Handlebars.js also adds the ability to define block helpers. Block helpers are f ```js var source = ""; Handlebars.registerHelper('link', function(context, options) { - return '' + context.fn(this) + ''; + return '' + options.fn(this) + ''; }); var template = Handlebars.compile(source); From 0ffb2a968146f170b39a65a01a394fa1366c6c36 Mon Sep 17 00:00:00 2001 From: Paul Banks Date: Sun, 30 Dec 2012 17:52:52 +0000 Subject: [PATCH 3/3] Duh. The example WAS right just really confusing due to bad variable naming --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index c3f05014..56042f4d 100644 --- a/README.markdown +++ b/README.markdown @@ -138,7 +138,7 @@ Handlebars.js also adds the ability to define block helpers. Block helpers are f ```js var source = "
    {{#people}}
  • {{#link}}{{name}}{{/link}}
  • {{/people}}
"; -Handlebars.registerHelper('link', function(context, options) { +Handlebars.registerHelper('link', function(options) { return '' + options.fn(this) + ''; }); var template = Handlebars.compile(source);