Skip to content

Commit

Permalink
Invalidate JS executor when loading fails
Browse files Browse the repository at this point in the history
Summary:
This solves #5090. Since 5b4e873 we had better reporting for when calls from native to JS fail. When trying to load an invalid bundle, this would now cause a stackoverflow, since RCTFatal would schedule a JS call to log, which would RCTFatal, which would ...

By invalidating the jsExecutor immediately after loading fails, we prevent any more attempts to log. We can't invalidate the whole bridge at this point since we still need the redbox module to actually display the error.

public

Reviewed By: majak

Differential Revision: D2834251

fb-gh-sync-id: a3e2ad425e40560beae4d3eacb93f66ace5341bf
  • Loading branch information
javache authored and facebook-github-bot-7 committed Jan 19, 2016
1 parent 58a448e commit 8ea9a1b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions React/Base/RCTBatchedBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ - (void)stopLoadingWithError:(NSError *)error
}

_loading = NO;
[_javaScriptExecutor invalidate];

[[NSNotificationCenter defaultCenter]
postNotificationName:RCTJavaScriptDidFailToLoadNotification
Expand Down

0 comments on commit 8ea9a1b

Please sign in to comment.