Skip to content

Commit

Permalink
Adding [super initialize] to correct misreporting by MDCD
Browse files Browse the repository at this point in the history
Summary:
In working to remove dead code from the code base, we identified that a number of classes that subclassed `RCTEventEmitter` were being reported as unused when they are in active use.  That was due to a lack of a `[super initialize]`.  This diff adds the call to super.

Changelog:
[General] [Added] - Call to `super` in `+initialize` of `RCTEventEmitter`

Reviewed By: javache

Differential Revision: D19727783

fbshipit-source-id: 19c6c7f08e7a8b2f764988fdfcd70f92dbf1b74b
  • Loading branch information
Marcus Zarra authored and facebook-github-bot committed Feb 5, 2020
1 parent 3797a6d commit 30790be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions React/Modules/RCTEventEmitter.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ + (NSString *)moduleName

+ (void)initialize
{
[super initialize];
if (self != [RCTEventEmitter class]) {
RCTAssert(RCTClassOverridesInstanceMethod(self, @selector(supportedEvents)),
@"You must override the `supportedEvents` method of %@", self);
Expand Down

0 comments on commit 30790be

Please sign in to comment.