allow for passing a context of evaluation to the importer

This commit is contained in:
cloudhead 2010-03-22 20:59:11 -04:00
parent e480289a29
commit 336b655e16

View File

@ -19,7 +19,7 @@ var less = {
require(path.join('less', 'tree', n));
});
less.Parser.importer = function (file, paths, callback) {
less.Parser.importer = function (file, paths, callback, context) {
var pathname;
paths.unshift('.');
@ -48,7 +48,7 @@ less.Parser.importer = function (file, paths, callback) {
paths: [path.dirname(pathname)]
}).parse(data, function (e, root) {
if (e) process.stdio.writeError(e);
callback(root);
callback.call(context || null, root);
});
});
});