Skip to content

Commit 5f84e88

Browse files
authored
Don't ignore errors in compiler.js --symbols-only (#19184)
Previously we would report the error but then exit with 0.
1 parent a831c41 commit 5f84e88

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/jsifier.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,9 @@ function ${name}(${args}) {
520520
includeFile('base64Utils.js');
521521
}
522522

523-
if (abortExecution) throw Error('Aborting compilation due to previous errors');
523+
if (abortExecution) {
524+
throw Error('Aborting compilation due to previous errors');
525+
}
524526

525527
// This is the main 'post' pass. Print out the generated code that we have here, together with the
526528
// rest of the output that we started to print out earlier (see comment on the
@@ -569,8 +571,11 @@ function ${name}(${args}) {
569571
deps: symbolDeps,
570572
asyncFuncs
571573
}));
572-
return;
574+
} else {
575+
finalCombiner();
573576
}
574577

575-
finalCombiner();
578+
if (abortExecution) {
579+
throw Error('Aborting compilation due to previous errors');
580+
}
576581
}

src/parseTools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function preprocess(filename) {
133133
error(`${filename}:${i + 1}: #error ${trimmed.substring(trimmed.indexOf(' ')).trim()}`);
134134
}
135135
} else {
136-
throw new Error(`${filename}:${i + 1}: Unknown preprocessor directive ${first}`);
136+
error(`${filename}:${i + 1}: Unknown preprocessor directive ${first}`);
137137
}
138138
} else {
139139
if (showCurrentLine()) {

0 commit comments

Comments
 (0)