Merge pull request #595 from hokaccha/fix_parser_error

Fix callback called two times
This commit is contained in:
Alexis Sellier
2012-02-01 11:54:00 -08:00

View File

@@ -317,17 +317,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