File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ RCT_EXTERN BOOL RCTGetDispatchW3CPointerEvents(void);
23
23
RCT_EXTERN void RCTSetDispatchW3CPointerEvents (BOOL value);
24
24
25
25
/*
26
- * Memory Pressure Unloading
26
+ * Validate RCTEventEmitter
27
27
*/
28
- RCT_EXTERN BOOL RCTGetDisableBridgeMemoryPressureUnload (void );
29
- RCT_EXTERN void RCTSetDisableBridgeMemoryPressureUnload (BOOL value);
28
+ RCT_EXTERN BOOL RCTGetValidateCanSendEventInRCTEventEmitter (void );
29
+ RCT_EXTERN void RCTSetValidateCanSendEventInRCTEventEmitter (BOOL value);
30
30
31
31
/*
32
32
* Memory Pressure Unloading Level
Original file line number Diff line number Diff line change @@ -41,18 +41,18 @@ void RCTSetDispatchW3CPointerEvents(BOOL value)
41
41
}
42
42
43
43
/*
44
- * Memory Pressure Unloading
44
+ * Validate RCTEventEmitter. For experimentation only.
45
45
*/
46
- static BOOL RCTDisableBridgeMemoryPressureUnload = NO ;
46
+ static BOOL RCTValidateCanSendEventInRCTEventEmitter = NO ;
47
47
48
- BOOL RCTGetDisableBridgeMemoryPressureUnload ()
48
+ BOOL RCTGetValidateCanSendEventInRCTEventEmitter ()
49
49
{
50
- return RCTDisableBridgeMemoryPressureUnload ;
50
+ return RCTValidateCanSendEventInRCTEventEmitter ;
51
51
}
52
52
53
- void RCTSetDisableBridgeMemoryPressureUnload (BOOL value)
53
+ void RCTSetValidateCanSendEventInRCTEventEmitter (BOOL value)
54
54
{
55
- RCTDisableBridgeMemoryPressureUnload = value;
55
+ RCTValidateCanSendEventInRCTEventEmitter = value;
56
56
}
57
57
58
58
/*
Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
#import " RCTEventEmitter.h"
9
+ #import < React/RCTConstants.h>
9
10
#import " RCTAssert.h"
10
11
#import " RCTLog.h"
11
12
#import " RCTUtils.h"
@@ -83,7 +84,11 @@ - (void)sendEventWithName:(NSString *)eventName body:(id)body
83
84
*/
84
85
- (BOOL )canSendEvents_DEPRECATED
85
86
{
86
- return _callableJSModules != nil ;
87
+ bool canSendEvents = _callableJSModules != nil ;
88
+ if (!canSendEvents && RCTGetValidateCanSendEventInRCTEventEmitter ()) {
89
+ RCTLogError (@" Trying to send event when _callableJSModules is nil." );
90
+ }
91
+ return canSendEvents;
87
92
}
88
93
89
94
- (void )startObserving
You can’t perform that action at this time.
0 commit comments