mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Drop RCT_EXPORT_METHOD from RCTExceptionsManager TurboModule (#57684)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57684 Changelog: [Internal] `RCTExceptionsManager` is a TurboModule: it conforms to `NativeExceptionsManagerSpec` and implements `getTurboModule:` returning the codegen'd `...SpecJSI`. For TurboModules, the JS->ObjC dispatch is driven by codegen (the generated spec supplies the `selector` and argument kinds, invoked at runtime via `NSMethodSignature` / `NSInvocation`), not by the `RCT_EXPORT_METHOD` macro's `__rct_export__` metadata. The exported methods here are async-void with concrete parameter types (no generic `id` requiring `RCTConvert` coercion), so the macro is not functionally required. Convert them to plain ObjC method declarations; conformance to the codegen'd `NativeExceptionsManagerSpec` protocol keeps compiler-enforced signature parity. Signature-only refactor with no change to the JS-facing API. Sync methods, methods with `id` params, and `constantsToExport` are intentionally left untouched. Reviewed By: cortinico Differential Revision: D113579875 fbshipit-source-id: 41aaed7f15443da5aadc0c18735732d4811dbe9b
This commit is contained in:
1 parent
42cc2ecc74
commit
a27d495b7c
1 file changed
+6
-8
@@ -87,24 +87,22 @@ RCT_EXPORT_MODULE()
|
||||
}
|
||||
|
||||
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
|
||||
RCT_EXPORT_METHOD(
|
||||
reportSoftException : (NSString *)message stack : (NSArray<NSDictionary *> *)stack exceptionId : (double)
|
||||
exceptionId)
|
||||
- (void)reportSoftException:(NSString *)message stack:(NSArray<NSDictionary *> *)stack exceptionId:(double)exceptionId
|
||||
{
|
||||
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
|
||||
}
|
||||
|
||||
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
|
||||
RCT_EXPORT_METHOD(
|
||||
reportFatalException : (NSString *)message stack : (NSArray<NSDictionary *> *)stack exceptionId : (double)
|
||||
exceptionId)
|
||||
- (void)reportFatalException:(NSString *)message stack:(NSArray<NSDictionary *> *)stack exceptionId:(double)exceptionId
|
||||
{
|
||||
[self reportFatal:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(dismissRedbox) {}
|
||||
- (void)dismissRedbox
|
||||
{
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData &)data)
|
||||
- (void)reportException:(JS::NativeExceptionsManager::ExceptionData &)data
|
||||
{
|
||||
NSMutableDictionary<NSString *, id> *mutableErrorData = [NSMutableDictionary new];
|
||||
mutableErrorData[@"message"] = data.message();
|
||||
|
||||
Reference in new issue
Block a user