presuppress Flow v0.201 errors

Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D43720099

fbshipit-source-id: 6931548c90deb82cfc7e3d8173ccfc6aa7f0e1c8
This commit is contained in:
Marshall Roch
2023-03-02 08:43:56 -08:00
committed by Facebook GitHub Bot
parent 05454fa866
commit b044ece594
2 changed files with 4 additions and 0 deletions
@@ -18,6 +18,7 @@ function codegenNativeCommands<T: interface {}>(options: Options<$Keys<T>>): T {
const commandObj: {[$Keys<T>]: (...$ReadOnlyArray<mixed>) => void} = {};
options.supportedCommands.forEach(command => {
// $FlowFixMe[missing-local-annot]
commandObj[command] = (ref, ...args) => {
// $FlowFixMe[incompatible-call]
dispatchCommand(ref, command, args);
+3
View File
@@ -38,6 +38,7 @@ function createParserErrorCapturer(): [
Array<ParserError>,
ParserErrorCapturer,
] {
// $FlowFixMe[missing-empty-array-annot]
const errors = [];
function guard<T>(fn: () => T): ?T {
try {
@@ -46,12 +47,14 @@ function createParserErrorCapturer(): [
if (!(error instanceof ParserError)) {
throw error;
}
// $FlowFixMe[incompatible-call]
errors.push(error);
return null;
}
}
// $FlowFixMe[incompatible-return]
return [errors, guard];
}