fix optimization option wrongly scoped

This commit is contained in:
cloudhead 2010-03-29 22:13:36 -04:00
parent 6086e903a8
commit 30bf1ff7f3

View File

@ -52,6 +52,8 @@ less.Parser = function Parser(env) {
inputLength, inputLength,
parser; parser;
var that = this;
// This function is called after all files // This function is called after all files
// have been imported through `@import`. // have been imported through `@import`.
var finish = function () {}; var finish = function () {};
@ -187,8 +189,8 @@ less.Parser = function Parser(env) {
// Either delimited by /\n\n/ or // Either delimited by /\n\n/ or
// delmited by '\n}' (see rationale above), // delmited by '\n}' (see rationale above),
// depending on the level of optimization. // depending on the level of optimization.
if (this.optimization > 0) { if (that.optimization > 0) {
if (this.optimization > 2) { if (that.optimization > 2) {
input = input.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g, ''); input = input.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g, '');
chunks = input.split(/^(?=\n)/mg); chunks = input.split(/^(?=\n)/mg);
} else { } else {