Skip to content

Commit

Permalink
Fix callback called two times
Browse files Browse the repository at this point in the history
  • Loading branch information
hokaccha committed Jan 25, 2012
1 parent 5c52f45 commit e58238b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/less/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e58238b

Please sign in to comment.