mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user