@samitouri / QOS-React / commits / e939cacf97

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.

Lauren Tan committed Oct 14, 2022 at 12:10 UTC e939cacf97e0dabfa61be4808e67a7d9466d2183
1 file changed -4
compiler/forget/src/PassManager.ts
-4
@@ -38,10 +38,6 @@ export class PassManager {
38 runPass(pass, this.program, this.context);
39 } catch (e) {
40 this.context.bailoutWithoutDiagnostic(`UnexpectedError: ${e}`);
41 - // console log stacktrace in jest
42 - if (global.__DEV__) {
43 - console.error(e.stack);
44 - }
41 if (hasMutatedBabelAST) {
42 // The AST has been mutated, we can't bail out anymore.
43 throw e;