diff --git a/lib/less/parser.js b/lib/less/parser.js index 51c8e03f5..268226e41 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -309,17 +309,21 @@ less.Parser = function Parser(env) { } } if (level > 0) { - return callback(new(LessError)({ + error = new(LessError)({ index: i, type: 'Parse', message: "missing closing `}`", filename: env.filename - }, env)); + }, env); } return chunks.map(function (c) { return c.join('') });; })([[]]); + if (error) { + return callback(error); + } + // Start with the primary rule. // The whole syntax tree is held under a Ruleset node, // with the `root` property set to true, so no `{}` are