diff --git a/lib/swig.js b/lib/swig.js index c9085242..0f794945 100644 --- a/lib/swig.js +++ b/lib/swig.js @@ -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)(); }; /** @@ -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; @@ -521,7 +521,7 @@ exports.Swig = function (opts) { return; } - return this.compileFile(pathName)(locals); + return self.compileFile(pathName)(locals); }; /**