packager: Module.js: cover the error cases

Summary: We want any exception thrown by `_getHasteName` to be captured by the promise instead of breaking the outer stack.

Reviewed By: davidaurelio

Differential Revision: D4754825

fbshipit-source-id: 173c7c8867da73efb198ed3159704d6fd0e7b87d
This commit is contained in:
Jean Lauliac 2017-03-22 11:59:40 -07:00 committed by Facebook Github Bot
parent 909d2e5503
commit 30548427ef
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ class Module {
return this._cache.get(
this.path,
'isHaste',
() => Promise.resolve(this._getHasteName() != null),
() => Promise.resolve().then(() => this._getHasteName() != null),
);
}