8000 Fix callback called two times · rusongyu/less.js@e58238b · GitHub
[go: up one dir, main page]

Skip to content

Commit e58238b

Browse files
committed
Fix callback called two times
1 parent 5c52f45 commit e58238b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/less/parser.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,21 @@ less.Parser = function Parser(env) {
309309
}
310310
}
311311
if (level > 0) {
312-
return callback(new(LessError)({
312+
error = new(LessError)({
313313
index: i,
314314
type: 'Parse',
315315
message: "missing closing `}`",
316316
filename: env.filename
317-
}, env));
317+
}, env);
318318
}
319319

320320
return chunks.map(function (c) { return c.join('') });;
321321
})([[]]);
322322

323+
if (error) {
324+
return callback(error);
325+
}
326+
323327
// Start with the primary rule.
324328
// The whole syntax tree is held under a Ruleset node,
325329
// with the `root` property set to true, so no `{}` are

0 commit comments

Comments
 (0)
2911
0