Permalink
Browse files

Merge pull request #595 from hokaccha/fix_parser_error

Fix callback called two times
  • Loading branch information...
2 parents f69de47 + e58238b commit 222f5e6b8a9598d82a353d10fd3c5ee655f5f6f9 @cloudhead cloudhead committed Feb 1, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/less/parser.js
View
@@ -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

0 comments on commit 222f5e6

Please sign in to comment.