mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[ez] Check for use-before-decl only when gating is on
This commit is contained in:
@@ -316,13 +316,15 @@ export function compileProgram(
|
||||
}
|
||||
);
|
||||
|
||||
const error = checkFunctionReferencedBeforeDeclarationAtTopLevel(
|
||||
program,
|
||||
compiledFns.map(({ originalFn }) => originalFn)
|
||||
);
|
||||
if (error) {
|
||||
handleError(pass, null, error);
|
||||
return;
|
||||
if (options.gating != null) {
|
||||
const error = checkFunctionReferencedBeforeDeclarationAtTopLevel(
|
||||
program,
|
||||
compiledFns.map(({ originalFn }) => originalFn)
|
||||
);
|
||||
if (error) {
|
||||
handleError(pass, null, error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (const { originalFn: fn, compiledFn } of compiledFns) {
|
||||
|
||||
Reference in New Issue
Block a user