From e58238bd17f77127ab862d991b8ec18de740ffc4 Mon Sep 17 00:00:00 2001 From: hokaccha Date: Wed, 25 Jan 2012 09:51:39 +0900 Subject: [PATCH] Fix callback called two times --- lib/less/parser.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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