From 6a5e7d10cebc0d71480a6756a3abc3401ccab563 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Wed, 30 Jun 2010 13:19:41 +0200 Subject: [PATCH] default to __filename when no filename in env --- lib/less/parser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index b7cbde4b..14b7fba5 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -170,7 +170,7 @@ less.Parser = function Parser(env) { } } - this.env = env || {}; + this.env = env = env || {}; // The optimization level dictates the thoroughness of the parser, // the lower the number, the less nodes it will create in the tree. @@ -178,6 +178,8 @@ less.Parser = function Parser(env) { // the individual nodes in the tree. this.optimization = ('optimization' in this.env) ? this.env.optimization : 1; + this.env.filename = this.env.filename || __filename; + // // The Parser //