only run validation if code is actually transformed

Disables post-codegen validation if there were no React functions in the input.
This commit is contained in:
Joseph Savona
2022-10-25 08:33:20 -07:00
parent eb13f84b2d
commit e262d9e5ba
2 changed files with 6 additions and 1 deletions
@@ -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;
+1 -1
View File
@@ -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(),