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 коммит произвёл Facebook Github Bot 3
Родитель 7446d42d33
Коммит fdc6240018
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

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