Skip to content

Commit b6bf1fd

Browse files
luluwu2032facebook-github-bot
authored andcommitted
Reland D38460203
Summary: D38460203 (facebook@e6ef083) was reverted because it broke OSS, the root cause is that OSS doesn't have MapBuffer module. Fixed the issue in this diff by moving MapBuffer usage to fb internal class (FBReactModule) and will re-land. Changelog: [iOS][Changed] Replace Folly with MapBuffer for passing js error data Reviewed By: sammy-SC Differential Revision: D39210957 fbshipit-source-id: dda0e8c55dbd13bc96310e10a3b09ea53978e8bc
1 parent 47a05bc commit b6bf1fd

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

React/CoreModules/BUCK

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_objc_arc_preprocessor_flags", "get_preprocessor_flags_for_build_mode")
2-
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_apple_library", "rn_extra_build_flags")
2+
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "react_native_xplat_target", "rn_apple_library", "rn_extra_build_flags")
33
load(
44
"@fbsource//xplat/configurations/buck/apple/plugins/sad_xplat_hosted_configurations:react_module_registration.bzl",
55
"react_module_plugin_providers",
@@ -129,6 +129,9 @@ rn_apple_library(
129129
],
130130
reexport_all_header_dependencies = True,
131131
visibility = ["PUBLIC"],
132+
deps = [
133+
react_native_xplat_target("react/renderer/mapbuffer:mapbufferApple"),
134+
],
132135
exported_deps = [
133136
"//xplat/js/react-native-github:FBReactNativeSpecApple",
134137
"//xplat/js/react-native-github:RCTLinkingApple",

React/CoreModules/RCTExceptionsManager.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ NS_ASSUME_NONNULL_BEGIN
3838
- (void)reportFatalException:(nullable NSString *)message
3939
stack:(nullable NSArray<NSDictionary *> *)stack
4040
exceptionId:(double)exceptionId;
41-
- (void)reportJsException:(NSString *)errorMap;
41+
- (void)reportJsException:(nullable NSString *)message
42+
stack:(nullable NSArray<NSDictionary *> *)stack
43+
exceptionId:(double)exceptionId
44+
isFatal:(bool)isFatal;
4245

4346
@property (nonatomic, weak) id<RCTExceptionsManagerDelegate> delegate;
4447

React/CoreModules/RCTExceptionsManager.mm

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,11 @@ - (void)reportFatal:(NSString *)message
150150
}
151151
}
152152

153-
- (void)reportJsException:(NSString *)errorStr
153+
- (void)reportJsException:(nullable NSString *)message
154+
stack:(nullable NSArray<NSDictionary *> *)stack
155+
exceptionId:(double)exceptionId
156+
isFatal:(bool)isFatal
154157
{
155-
NSData *jsonData = [errorStr dataUsingEncoding:NSUTF8StringEncoding];
156-
NSError *jsonError;
157-
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData
158-
options:NSJSONWritingPrettyPrinted
159-
error:&jsonError];
160-
161-
NSString *message = [dict objectForKey:@"message"];
162-
double exceptionId = [[dict objectForKey:@"id"] doubleValue];
163-
NSArray *stack = [dict objectForKey:@"stack"];
164-
BOOL isFatal = [[dict objectForKey:@"isFatal"] boolValue];
165-
166158
if (isFatal) {
167159
[self reportFatalException:message stack:stack exceptionId:exceptionId];
168160
} else {

0 commit comments

Comments
 (0)