mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Delete ReactFeatureFlags.rejectTurboModulePromiseOnNativeError (#45583)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45583 ReactFeatureFlags.rejectTurboModulePromiseOnNativeError is not used, I'm deleteing it changelog: [internal] internal Reviewed By: NickGerleman Differential Revision: D60022938 fbshipit-source-id: 80f2d551b4416fae81c9081d3ddbb896e5f5a560
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d4a74d8b83
commit
4d77c35584
@@ -1970,7 +1970,6 @@ public class com/facebook/react/config/ReactFeatureFlags {
|
||||
public static field enableFabricRenderer Z
|
||||
public static field enableViewRecycling Z
|
||||
public static field excludeYogaFromRawProps Z
|
||||
public static field rejectTurboModulePromiseOnNativeError Z
|
||||
public static field traceTurboModulePromiseRejections Z
|
||||
public static field unstable_enableTurboModuleSyncVoidMethods Z
|
||||
public static field unstable_useFabricInterop Z
|
||||
|
||||
-6
@@ -84,10 +84,4 @@ public class ReactFeatureFlags {
|
||||
* of Promise rejection and tracing the cause.
|
||||
*/
|
||||
public static boolean traceTurboModulePromiseRejections = ReactBuildConfig.DEBUG;
|
||||
|
||||
/**
|
||||
* Enables auto rejecting promises from Turbo Modules method calls. If native error occurs Promise
|
||||
* in JS will be rejected (The JS error will include native stack)
|
||||
*/
|
||||
public static boolean rejectTurboModulePromiseOnNativeError = true;
|
||||
}
|
||||
|
||||
+5
-13
@@ -75,12 +75,6 @@ bool traceTurboModulePromiseRejections() {
|
||||
return traceRejections;
|
||||
}
|
||||
|
||||
bool rejectTurboModulePromiseOnNativeError() {
|
||||
static bool rejectOnError =
|
||||
getFeatureFlagBoolValue("rejectTurboModulePromiseOnNativeError");
|
||||
return rejectOnError;
|
||||
}
|
||||
|
||||
struct JNIArgs {
|
||||
JNIArgs(size_t count) : args(count) {}
|
||||
JNIArgs(const JNIArgs&) = delete;
|
||||
@@ -900,12 +894,10 @@ jsi::Value JavaTurboModule::invokeJavaMethod(
|
||||
throw jsi::JSError(runtime, "Incorrect number of arguments");
|
||||
}
|
||||
|
||||
if (rejectTurboModulePromiseOnNativeError()) {
|
||||
nativeRejectCallback = AsyncCallback(
|
||||
runtime,
|
||||
args[1].getObject(runtime).getFunction(runtime),
|
||||
jsInvoker_);
|
||||
}
|
||||
nativeRejectCallback = AsyncCallback(
|
||||
runtime,
|
||||
args[1].getObject(runtime).getFunction(runtime),
|
||||
jsInvoker_);
|
||||
|
||||
auto resolve = createJavaCallback(
|
||||
runtime,
|
||||
@@ -975,7 +967,7 @@ jsi::Value JavaTurboModule::invokeJavaMethod(
|
||||
try {
|
||||
FACEBOOK_JNI_THROW_PENDING_EXCEPTION();
|
||||
} catch (...) {
|
||||
if (rejectTurboModulePromiseOnNativeError() && rejectCallback) {
|
||||
if (rejectCallback) {
|
||||
auto exception = std::current_exception();
|
||||
rejectWithException(
|
||||
*rejectCallback, exception, jsInvocationStack);
|
||||
|
||||
Reference in New Issue
Block a user