packager: node-haste: do not expose HasteMap

Reviewed By: davidaurelio

Differential Revision: D4598085

fbshipit-source-id: d993be8e3bdcfda018a898b4adb32b53c1f0a948
This commit is contained in:
Jean Lauliac 2017-02-23 03:31:36 -08:00 committed by Facebook Github Bot
parent 3a1af41a5d
commit 4a4dddbfdc
1 changed files with 3 additions and 4 deletions

View File

@ -81,7 +81,7 @@ class DependencyGraph {
_helpers: DependencyGraphHelpers;
_moduleCache: ModuleCache;
_loading: Promise<mixed>;
_loading: Promise<void>;
constructor(opts: Options) {
this._opts = {...opts};
@ -89,7 +89,7 @@ class DependencyGraph {
this.load();
}
load() {
load(): Promise<void> {
if (this._loading) {
return this._loading;
}
@ -164,7 +164,6 @@ class DependencyGraph {
log(createActionEndEntry(buildingHasteMapLogEntry));
log(createActionEndEntry(initializingPackagerLogEntry));
this._opts.reporter.update({type: 'dep_graph_loaded'});
return map;
},
err => {
const error = new Error(
@ -300,7 +299,7 @@ class DependencyGraph {
this._hasteMapError = null;
// Rebuild the entire map if last change resulted in an error.
this._loading = this._hasteMap.build();
this._loading = this._hasteMap.build().then(() => {});
} else {
this._loading = this._hasteMap.processFileChange(type, filePath);
this._loading.catch(error => {