Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
Fix scoping for Express. Fixes gh-363
Browse files Browse the repository at this point in the history
  • Loading branch information
paularmstrong committed Dec 3, 2013
1 parent a8f4f86 commit 2ecef8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/swig.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ exports.Swig = function (opts) {
* @return {string} Rendered output.
*/
this.render = function (source, options) {
return this.compile(source, options)();
return self.compile(source, options)();
};

/**
Expand All @@ -511,7 +511,7 @@ exports.Swig = function (opts) {
*/
this.renderFile = function (pathName, locals, cb) {
if (cb) {
this.compileFile(pathName, {}, function (err, fn) {
self.compileFile(pathName, {}, function (err, fn) {
if (err) {
cb(err);
return;
Expand All @@ -521,7 +521,7 @@ exports.Swig = function (opts) {
return;
}

return this.compileFile(pathName)(locals);
return self.compileFile(pathName)(locals);
};

/**
Expand Down

0 comments on commit 2ecef8f

Please sign in to comment.