diff --git a/compiler/forget/src/BackEnd/PostCodegenValidator.ts b/compiler/forget/src/BackEnd/PostCodegenValidator.ts index a35191feff..e81acace0a 100644 --- a/compiler/forget/src/BackEnd/PostCodegenValidator.ts +++ b/compiler/forget/src/BackEnd/PostCodegenValidator.ts @@ -20,6 +20,11 @@ export default { }; export function run(lirProg: LIR.Prog, context: CompilerContext) { + // Only run validation if the input has React functions and was successfully + // transformed (no bailouts) + if (lirProg.funcs.size === 0 || context.bailouts.length !== 0) { + return; + } const postCodegenValidator = context.opts.postCodegenValidator; if (postCodegenValidator === null) { return; diff --git a/compiler/forget/src/CompilerOptions.ts b/compiler/forget/src/CompilerOptions.ts index 1ebaa65b2b..d0a5d91c88 100644 --- a/compiler/forget/src/CompilerOptions.ts +++ b/compiler/forget/src/CompilerOptions.ts @@ -151,7 +151,7 @@ export function createCompilerOptions(): CompilerOptions { return { outputKinds: [OutputKind.JS], flags: createCompilerFlags(), - stopPass: PassName.JSGen, + stopPass: PassName.Validator, optIn: false, logger: noopLogger, allowedCapitalizedUserFunctions: new Set(),