mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Temporarily get rid of not nullable boolean and number checks
Summary: NativeUIManager and NativeAnimatedModule are using nullable args. I believe we may teporarly don't care about that Reviewed By: RSNara Differential Revision: D16282683 fbshipit-source-id: 8071a9446c0e1e437391db17c16f82e131094c81
This commit is contained in:
committed by
Facebook Github Bot
parent
b4ac9ddcd5
commit
ae840287e6
-50
@@ -159,54 +159,6 @@ export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
|
||||
|
||||
`;
|
||||
|
||||
const NATIVE_MODULE_NULLABLE_BOOLEAN = `
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import type {TurboModule} from '../RCTExport';
|
||||
import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getSth(a : ?boolean) => void
|
||||
}
|
||||
|
||||
export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
|
||||
|
||||
`;
|
||||
|
||||
const NATIVE_MODULE_NULLABLE_NUMBER = `
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import type {TurboModule} from '../RCTExport';
|
||||
import * as TurboModuleRegistry from '../TurboModuleRegistry';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getSth(a : ?number) => void
|
||||
}
|
||||
|
||||
export default TurboModuleRegistry.getEnforcing<Spec>('SampleTurboModule');
|
||||
|
||||
`;
|
||||
|
||||
const TWO_NATIVE_MODULES_EXPORTED_WITH_DEFAULT = `
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
@@ -260,8 +212,6 @@ module.exports = {
|
||||
NATIVE_MODULES_WITH_PROMISE_WITHOUT_TYPE,
|
||||
NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT_AS_PARAM,
|
||||
NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT,
|
||||
NATIVE_MODULE_NULLABLE_BOOLEAN,
|
||||
NATIVE_MODULE_NULLABLE_NUMBER,
|
||||
TWO_NATIVE_MODULES_EXPORTED_WITH_DEFAULT,
|
||||
NATIVE_MODULES_WITH_NOT_EXISTING_TYPE_AS_PARAM,
|
||||
NATIVE_MODULES_WITH_NOT_EXISTING_TYPE_AS_RETURN,
|
||||
|
||||
-4
@@ -1,9 +1,5 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`RN Codegen Flow Parser Fails with error message NATIVE_MODULE_NULLABLE_BOOLEAN 1`] = `"Booleans and numbers cannot be nullable for param \\"a in method \\"getSth\\"."`;
|
||||
|
||||
exports[`RN Codegen Flow Parser Fails with error message NATIVE_MODULE_NULLABLE_NUMBER 1`] = `"Booleans and numbers cannot be nullable for param \\"a in method \\"getSth\\"."`;
|
||||
|
||||
exports[`RN Codegen Flow Parser Fails with error message NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT 1`] = `"Unsupported return type for getString: expected to find annotation for type of array contents"`;
|
||||
|
||||
exports[`RN Codegen Flow Parser Fails with error message NATIVE_MODULES_WITH_ARRAY_WITH_NO_TYPE_FOR_CONTENT_AS_PARAM 1`] = `"Unsupported type for getString, param: \\"arg\\": expected to find annotation for type of array contents"`;
|
||||
|
||||
@@ -201,12 +201,6 @@ function getTypeAnnotationForParam(
|
||||
};
|
||||
case 'NumberTypeAnnotation':
|
||||
case 'BooleanTypeAnnotation':
|
||||
if (nullable) {
|
||||
throw new Error(
|
||||
`Booleans and numbers cannot be nullable for param "${paramName} in method "${name}".`,
|
||||
);
|
||||
}
|
||||
// eslint-disable no-fallthrough
|
||||
case 'StringTypeAnnotation':
|
||||
return {
|
||||
nullable,
|
||||
|
||||
Reference in New Issue
Block a user