Fix callback called two times

This commit is contained in:
hokaccha
2012-01-25 09:51:39 +09:00
parent 5c52f4579c
commit e58238bd17

View File

@@ -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