Don't console.error in dev

Previously the PassManager would console.error if an unexpected error was 
thrown, to help with debugging jest. However because we now capture all 
invariants in compiler passes as bailouts, these are already captured in fixture 
tests. 

Additionally, we also already console.error if we find an unexpected bailout in 
a fixture test. So this is purely redundant and removing reduces some noise when 
running tests.
This commit is contained in:
Lauren Tan
2022-10-14 12:10:58 -04:00
parent 101ee3a440
commit e939cacf97
-4
View File
@@ -38,10 +38,6 @@ export class PassManager {
runPass(pass, this.program, this.context);
} catch (e) {
this.context.bailoutWithoutDiagnostic(`UnexpectedError: ${e}`);
// console log stacktrace in jest
if (global.__DEV__) {
console.error(e.stack);
}
if (hasMutatedBabelAST) {
// The AST has been mutated, we can't bail out anymore.
throw e;