summaryrefslogtreecommitdiffstats
path: root/lib/template.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-09-15 12:38:13 +0200
committerSamy Pessé <samypesse@gmail.com>2015-09-15 12:38:13 +0200
commit5f56098ae7fae80a4dd75a944c38201560b480c6 (patch)
tree6f6372c32e10a144371af6013925d2fa4395d6d8 /lib/template.js
parent0f935f4372e408548ec3cb64ec8294e064b71f8b (diff)
downloadgitbook-5f56098ae7fae80a4dd75a944c38201560b480c6.zip
gitbook-5f56098ae7fae80a4dd75a944c38201560b480c6.tar.gz
gitbook-5f56098ae7fae80a4dd75a944c38201560b480c6.tar.bz2
Fix stupid error that passed tests because "context" was global
Diffstat (limited to 'lib/template.js')
-rw-r--r--lib/template.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/template.js b/lib/template.js
index 9f01d3c..41362c8 100644
--- a/lib/template.js
+++ b/lib/template.js
@@ -330,7 +330,7 @@ TemplateEngine.prototype.applyBlock = function(name, blk) {
// Bind and call block processor
func = this.bindContext(block.process);
- r = func.call(context, blk);
+ r = func(blk);
if (Q.isPromise(r)) return r.then(normBlockResult);
else return normBlockResult(r);
@@ -399,7 +399,7 @@ TemplateEngine.prototype.renderPage = function(page) {
return that.book.statFile(page.path)
.then(function(stat) {
- context = {
+ var context = {
// infos about the file
file: {
path: page.path,