mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
84 lines
2.5 KiB
Objective-C
84 lines
2.5 KiB
Objective-C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RCTConstants.h"
|
|
|
|
NSString *const RCTUserInterfaceStyleDidChangeNotification = @"RCTUserInterfaceStyleDidChangeNotification";
|
|
NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey = @"traitCollection";
|
|
|
|
NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
|
|
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";
|
|
NSString *const RCTJavaScriptWillStartExecutingNotification = @"RCTJavaScriptWillStartExecutingNotification";
|
|
NSString *const RCTJavaScriptWillStartLoadingNotification = @"RCTJavaScriptWillStartLoadingNotification";
|
|
|
|
NSString *const RCTDidInitializeModuleNotification = @"RCTDidInitializeModuleNotification";
|
|
NSString *const RCTDidSetupModuleNotification = @"RCTDidSetupModuleNotification";
|
|
NSString *const RCTDidSetupModuleNotificationModuleNameKey = @"moduleName";
|
|
NSString *const RCTDidSetupModuleNotificationSetupTimeKey = @"setupTime";
|
|
|
|
/*
|
|
* W3C Pointer Events
|
|
*/
|
|
static BOOL RCTDispatchW3CPointerEvents = NO;
|
|
|
|
BOOL RCTGetDispatchW3CPointerEvents()
|
|
{
|
|
return RCTDispatchW3CPointerEvents;
|
|
}
|
|
|
|
void RCTSetDispatchW3CPointerEvents(BOOL value)
|
|
{
|
|
RCTDispatchW3CPointerEvents = value;
|
|
}
|
|
|
|
/*
|
|
* Validate RCTEventEmitter. For experimentation only.
|
|
*/
|
|
static BOOL RCTValidateCanSendEventInRCTEventEmitter = NO;
|
|
|
|
BOOL RCTGetValidateCanSendEventInRCTEventEmitter()
|
|
{
|
|
return RCTValidateCanSendEventInRCTEventEmitter;
|
|
}
|
|
|
|
void RCTSetValidateCanSendEventInRCTEventEmitter(BOOL value)
|
|
{
|
|
RCTValidateCanSendEventInRCTEventEmitter = value;
|
|
}
|
|
|
|
/*
|
|
* Memory Pressure Unloading Level for experimentation only.
|
|
* Default is 15, which is TRIM_MEMORY_RUNNING_CRITICAL.
|
|
*/
|
|
static int RCTMemoryPressureUnloadLevel = 15;
|
|
|
|
BOOL RCTGetMemoryPressureUnloadLevel()
|
|
{
|
|
return RCTMemoryPressureUnloadLevel;
|
|
}
|
|
|
|
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;
|
|
}
|