mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
cleanup: ExceptionsManager: Delete updateExceptionMessage (#47167)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47167 I couldn't find any usages of this method in javascript. Removing, so that the native code is easier to read. Changelog: [Internal] Reviewed By: javache Differential Revision: D64606928 fbshipit-source-id: 1d52d58437370ae3d99e9c44500080687f137191
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f8788963b9
commit
4f47439a02
@@ -14,7 +14,6 @@ import typeof NativeExceptionsManager from '../NativeExceptionsManager';
|
||||
export default ({
|
||||
reportFatalException: jest.fn(),
|
||||
reportSoftException: jest.fn(),
|
||||
updateExceptionMessage: jest.fn(),
|
||||
dismissRedbox: jest.fn(),
|
||||
reportException: jest.fn(),
|
||||
}: NativeExceptionsManager);
|
||||
|
||||
@@ -67,8 +67,6 @@ function runExceptionsManagerTests() {
|
||||
return {
|
||||
default: {
|
||||
reportException: jest.fn(),
|
||||
// Used to show symbolicated messages, not part of this test.
|
||||
updateExceptionMessage: () => {},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCTExceptionsManagerDelegate <NSObject>
|
||||
|
||||
- (void)handleSoftJSExceptionWithMessage:(nullable NSString *)message
|
||||
stack:(nullable NSArray *)stack
|
||||
exceptionId:(NSNumber *)exceptionId
|
||||
@@ -20,12 +19,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
stack:(nullable NSArray *)stack
|
||||
exceptionId:(NSNumber *)exceptionId
|
||||
extraDataAsJSON:(nullable NSString *)extraDataAsJSON;
|
||||
|
||||
@optional
|
||||
- (void)updateJSExceptionWithMessage:(nullable NSString *)message
|
||||
stack:(nullable NSArray *)stack
|
||||
exceptionId:(NSNumber *)exceptionId;
|
||||
|
||||
@end
|
||||
|
||||
@interface RCTExceptionsManager : NSObject <RCTBridgeModule>
|
||||
|
||||
@@ -99,21 +99,6 @@ RCT_EXPORT_METHOD(reportFatalException
|
||||
[self reportFatal:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(updateExceptionMessage
|
||||
: (NSString *)message stack
|
||||
: (NSArray<NSDictionary *> *)stack exceptionId
|
||||
: (double)exceptionId)
|
||||
{
|
||||
if (RCTRedBoxGetEnabled()) {
|
||||
RCTRedBox *redbox = [_moduleRegistry moduleForName:"RedBox"];
|
||||
[redbox updateErrorMessage:message withStack:stack errorCookie:(int)exceptionId];
|
||||
}
|
||||
|
||||
if (_delegate && [_delegate respondsToSelector:@selector(updateJSExceptionWithMessage:stack:exceptionId:)]) {
|
||||
[_delegate updateJSExceptionWithMessage:message stack:stack exceptionId:[NSNumber numberWithDouble:exceptionId]];
|
||||
}
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(dismissRedbox) {}
|
||||
|
||||
RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData &)data)
|
||||
|
||||
@@ -2212,7 +2212,6 @@ public abstract class com/facebook/react/devsupport/DevSupportManagerBase : com/
|
||||
public fun startInspector ()V
|
||||
public fun stopInspector ()V
|
||||
public fun toggleElementInspector ()V
|
||||
public fun updateJSError (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;I)V
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/devsupport/DevSupportManagerBase$CallbackWithBundleLoader {
|
||||
@@ -2380,7 +2379,6 @@ public class com/facebook/react/devsupport/ReleaseDevSupportManager : com/facebo
|
||||
public fun startInspector ()V
|
||||
public fun stopInspector ()V
|
||||
public fun toggleElementInspector ()V
|
||||
public fun updateJSError (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;I)V
|
||||
}
|
||||
|
||||
public class com/facebook/react/devsupport/StackTraceHelper {
|
||||
@@ -2516,7 +2514,6 @@ public abstract interface class com/facebook/react/devsupport/interfaces/DevSupp
|
||||
public abstract fun startInspector ()V
|
||||
public abstract fun stopInspector ()V
|
||||
public abstract fun toggleElementInspector ()V
|
||||
public abstract fun updateJSError (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;I)V
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/devsupport/interfaces/DevSupportManager$PackagerLocationCustomizer {
|
||||
@@ -3138,7 +3135,6 @@ public class com/facebook/react/modules/core/ExceptionsManagerModule : com/faceb
|
||||
public fun reportException (Lcom/facebook/react/bridge/ReadableMap;)V
|
||||
public fun reportFatalException (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;D)V
|
||||
public fun reportSoftException (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;D)V
|
||||
public fun updateExceptionMessage (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;D)V
|
||||
}
|
||||
|
||||
public class com/facebook/react/modules/core/HeadlessJsTaskSupportModule : com/facebook/fbreact/specs/NativeHeadlessJsTaskSupportSpec {
|
||||
|
||||
-20
@@ -279,26 +279,6 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
||||
return errorInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJSError(
|
||||
final String message, final ReadableArray details, final int errorCookie) {
|
||||
UiThreadUtil.runOnUiThread(
|
||||
() -> {
|
||||
// Since we only show the first JS error in a succession of JS errors, make sure we only
|
||||
// update the error message for that error message. This assumes that updateJSError
|
||||
// belongs to the most recent showNewJSError
|
||||
if ((mRedBoxSurfaceDelegate != null && !mRedBoxSurfaceDelegate.isShowing())
|
||||
|| errorCookie != mLastErrorCookie) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The RedBox surface delegate will always show the latest error
|
||||
updateLastErrorInfo(
|
||||
message, StackTraceHelper.convertJsStackTrace(details), errorCookie, ErrorType.JS);
|
||||
mRedBoxSurfaceDelegate.show();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideRedboxDialog() {
|
||||
if (mRedBoxSurfaceDelegate == null) {
|
||||
|
||||
-6
@@ -53,12 +53,6 @@ public open class ReleaseDevSupportManager : DevSupportManager {
|
||||
|
||||
override public fun destroyRootView(rootView: View?): Unit = Unit
|
||||
|
||||
override public fun updateJSError(
|
||||
message: String?,
|
||||
details: ReadableArray?,
|
||||
errorCookie: Int
|
||||
): Unit = Unit
|
||||
|
||||
override public fun hideRedboxDialog(): Unit = Unit
|
||||
|
||||
override public fun showDevOptionsDialog(): Unit = Unit
|
||||
|
||||
-2
@@ -48,8 +48,6 @@ public interface DevSupportManager : JSExceptionHandler {
|
||||
|
||||
public fun showNewJSError(message: String?, details: ReadableArray?, errorCookie: Int)
|
||||
|
||||
public fun updateJSError(message: String?, details: ReadableArray?, errorCookie: Int)
|
||||
|
||||
public fun hideRedboxDialog()
|
||||
|
||||
public fun showDevOptionsDialog()
|
||||
|
||||
-11
@@ -60,17 +60,6 @@ public open class ExceptionsManagerModule(private val devSupportManager: DevSupp
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateExceptionMessage(
|
||||
title: String?,
|
||||
details: ReadableArray?,
|
||||
exceptionIdDouble: Double
|
||||
) {
|
||||
val exceptionId = exceptionIdDouble.toInt()
|
||||
if (devSupportManager.devSupportEnabled) {
|
||||
devSupportManager.updateJSError(title, details, exceptionId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismissRedbox() {
|
||||
if (devSupportManager.devSupportEnabled) {
|
||||
devSupportManager.hideRedboxDialog()
|
||||
|
||||
@@ -47,11 +47,6 @@ export interface Spec extends TurboModule {
|
||||
exceptionId: number,
|
||||
) => void;
|
||||
+reportException?: (data: ExceptionData) => void;
|
||||
+updateExceptionMessage: (
|
||||
message: string,
|
||||
stack: Array<StackFrame>,
|
||||
exceptionId: number,
|
||||
) => void;
|
||||
// TODO(T53311281): This is a noop on iOS now. Implement it.
|
||||
+dismissRedbox?: () => void;
|
||||
}
|
||||
@@ -74,13 +69,6 @@ const ExceptionsManager = {
|
||||
) {
|
||||
NativeModule.reportSoftException(message, stack, exceptionId);
|
||||
},
|
||||
updateExceptionMessage(
|
||||
message: string,
|
||||
stack: Array<StackFrame>,
|
||||
exceptionId: number,
|
||||
) {
|
||||
NativeModule.updateExceptionMessage(message, stack, exceptionId);
|
||||
},
|
||||
dismissRedbox(): void {
|
||||
if (Platform.OS !== 'ios' && NativeModule.dismissRedbox) {
|
||||
// TODO(T53311281): This is a noop on iOS now. Implement it.
|
||||
|
||||
Reference in New Issue
Block a user