From d8d42c7310acd90fbed53aa409ef8b557dc9ec00 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Sun, 3 Mar 2019 20:01:22 -0800 Subject: [PATCH] Added support of __nullable and __nonnull for module exported method signature (#23731) Summary: For the `NullabilityPostfix`, we can use `_Nullable` or `__nullable`. Please see https://developer.apple.com/swift/blog/?id=25 , and we also use it in our code. [iOS] [Added] - Added support of __nullable and __nonnull for module exported method signature Pull Request resolved: https://github.com/facebook/react-native/pull/23731 Differential Revision: D14298483 Pulled By: cpojer fbshipit-source-id: 4dd3188f51be3808ea2b97ce19aa7a85ea1f4a9e --- React/Base/RCTModuleMethod.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/React/Base/RCTModuleMethod.mm b/React/Base/RCTModuleMethod.mm index 767e11abd41..ada62d085f0 100644 --- a/React/Base/RCTModuleMethod.mm +++ b/React/Base/RCTModuleMethod.mm @@ -106,9 +106,11 @@ static RCTNullability RCTParseNullability(const char **input) static RCTNullability RCTParseNullabilityPostfix(const char **input) { - if (RCTReadString(input, "_Nullable")) { + if (RCTReadString(input, "_Nullable") || + RCTReadString(input, "__nullable")) { return RCTNullable; - } else if (RCTReadString(input, "_Nonnull")) { + } else if (RCTReadString(input, "_Nonnull") || + RCTReadString(input, "__nonnull")) { return RCTNonnullable; } return RCTNullabilityUnspecified;