Skip to content

Commit 3f97e1a

Browse files
authored
fix: Fix incorrect callback return when validating modules in asc (#1383)
1 parent fbba2e4 commit 3f97e1a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: cli/asc.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -653,12 +653,14 @@ exports.main = function main(argv, options, callback) {
653653
// Validate the module if requested
654654
if (!args.noValidate) {
655655
stats.validateCount++;
656+
let isValid;
656657
stats.validateTime += measure(() => {
657-
if (!module.validate()) {
658-
module.dispose();
659-
return callback(Error("Validate error"));
660-
}
658+
isValid = module.validate();
661659
});
660+
if (!isValid) {
661+
module.dispose();
662+
return callback(Error("validate error"));
663+
}
662664
}
663665

664666
// Set Binaryen-specific options

0 commit comments

Comments
 (0)