8000 fix optimization option wrongly scoped · rusongyu/less.js@660d2f7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 660d2f7

Browse files
author
cloudhead
committed
fix optimization option wrongly scoped
1 parent be2e675 commit 660d2f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/less/parser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ less.Parser = function Parser(env) {
5252
inputLength,
5353
parser;
5454

55+
var that = this;
56+
5557
// This function is called after all files
5658
// have been imported through `@import`.
5759
var finish = function () {};
@@ -187,8 +189,8 @@ less.Parser = function Parser(env) {
187189
// Either delimited by /\n\n/ or
188190
// delmited by '\n}' (see rationale above),
189191
// depending on the level of optimization.
190-
if (this.optimization > 0) {
191-
if (this.optimization > 2) {
192+
if (that.optimization > 0) {
193+
if (that.optimization > 2) {
192194
input = input.replace(/\/\*(?:[^*]|\*+[^\/*])*\*+\//g, '');
193195
chunks = input.split(/^(?=\n)/mg);
194196
} else {

0 commit comments

Comments
 (0)
0