From e939cacf97e0dabfa61be4808e67a7d9466d2183 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 14 Oct 2022 12:10:58 -0400 Subject: [PATCH] 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. --- compiler/forget/src/PassManager.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler/forget/src/PassManager.ts b/compiler/forget/src/PassManager.ts index 0458f22c51..888358bbf0 100644 --- a/compiler/forget/src/PassManager.ts +++ b/compiler/forget/src/PassManager.ts @@ -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;