From 660d2f76ba2b630d4aa76878e0ba0504591a47cb Mon Sep 17 00:00:00 2001 From: cloudhead Date: Mon, 29 Mar 2010 22:13:36 -0400 Subject: [PATCH] fix optimization option wrongly scoped --- lib/less/parser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index d2f77723..ac77b407 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -52,6 +52,8 @@ less.Parser = function Parser(env) { inputLength, parser; + var that = this; + // This function is called after all files // have been imported through `@import`. var finish = function () {}; @@ -187,8 +189,8 @@ less.Parser = function Parser(env) { // Either delimited by /\n\n/ or // delmited by '\n}' (see rationale above), // depending on the level of optimization. - if (this.optimization > 0) { - if (this.optimization > 2) { + if (that.optimization > 0) { + if (that.optimization > 2) { input = input.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g, ''); chunks = input.split(/^(?=\n)/mg); } else {