Skip to content

Commit 4fc4dd1

Browse files
authored
feat: Check for transform diagnostics after 'afterCompile' (AssemblyScript#1983)
1 parent 62071b7 commit 4fc4dd1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: cli/asc.js

+8
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,14 @@ exports.main = function main(argv, options, callback) {
912912
if (error) return callback(error);
913913
}
914914

915+
numErrors = checkDiagnostics(program, stderr, options.reportDiagnostic);
916+
if (numErrors) {
917+
if (module) module.dispose();
918+
const err = Error(`${numErrors} afterCompile error(s)`);
919+
err.stack = err.message; // omit stack
920+
return callback(err);
921+
}
922+
915923
// Validate the module if requested
916924
if (!opts.noValidate) {
917925
stats.validateCount++;

0 commit comments

Comments
 (0)