mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
3/n Easy: Add MC to gate parsing unhandled JS errors in C++
Summary: Changelog: [Internal][ErrorHandling] 3/n Add a gate for parsing unhandled JS errors in C++ Gate this just in case it causes issues. Enabling this is definitely a better behavior than before, because we want the JS stack when there is a JS error, not the native stack. Reviewed By: sammy-SC Differential Revision: D40397393 fbshipit-source-id: 586b4d7bcf710edb048b5c643646ba2f3c4c302a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b51a350c1e
commit
afb124dcf0
@@ -75,3 +75,9 @@ RCT_EXTERN void RCTSetValidateCanSendEventInRCTEventEmitter(BOOL value);
|
||||
*/
|
||||
RCT_EXTERN BOOL RCTGetMemoryPressureUnloadLevel(void);
|
||||
RCT_EXTERN void RCTSetMemoryPressureUnloadLevel(int value);
|
||||
|
||||
/*
|
||||
* Parse JS stack for unhandled JS errors caught in C++
|
||||
*/
|
||||
RCT_EXTERN BOOL RCTGetParseUnhandledJSErrorStackNatively(void);
|
||||
RCT_EXTERN void RCTSetParseUnhandledJSErrorStackNatively(BOOL value);
|
||||
|
||||
@@ -65,3 +65,19 @@ void RCTSetMemoryPressureUnloadLevel(int value)
|
||||
{
|
||||
RCTMemoryPressureUnloadLevel = value;
|
||||
}
|
||||
|
||||
/*
|
||||
* In Bridge mode, parse the JS stack for unhandled JS errors, to display in RedBox.
|
||||
* When false (previous default behavior), a native stack is displayed in the RedBox.
|
||||
*/
|
||||
static BOOL RCTParseUnhandledJSErrorStackNatively = NO;
|
||||
|
||||
BOOL RCTGetParseUnhandledJSErrorStackNatively()
|
||||
{
|
||||
return RCTParseUnhandledJSErrorStackNatively;
|
||||
}
|
||||
|
||||
void RCTSetParseUnhandledJSErrorStackNatively(BOOL value)
|
||||
{
|
||||
RCTParseUnhandledJSErrorStackNatively = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user