Skip to content

Commit

Permalink
Merge pull request less#595 from hokaccha/fix_parser_error
Browse files Browse the repository at this point in the history
Fix callback called two times
  • Loading branch information
cloudhead committed Feb 1, 2012
2 parents f69de47 + e58238b commit 222f5e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/less/parser.js
Expand Up @@ -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
Expand Down

0 comments on commit 222f5e6

Please sign in to comment.