Reset hasError flag after HMR request

Summary:
This got broken recently. As a result of this, when a module throws while being required, either by regular load or hot reload, the module object is marked as `hasError`. Form that point all subsequent HMR updates will fail because it will think the module failed while executing the factory but the failure could have been on an old run of an old factory.

The fix is very simple: just reset `hasError` to false when accepting a module.
Closes https://github.com/facebook/react-native/pull/7567

Differential Revision: D3310685

fbshipit-source-id: 2f0b48ab7432b7c221d0c88a019a28969a8862b2
This commit is contained in:
Martín Bigio 2016-05-17 11:45:49 -07:00 committed by Facebook Github Bot 3
parent 56c3a581b0
commit 5fbd3751a0
1 changed files with 1 additions and 0 deletions

View File

@ -205,6 +205,7 @@ if (__DEV__) {
if (factory) {
mod.factory = factory;
}
mod.hasError = false;
mod.isInitialized = false;
require(id);