From a8570b6b98669747645636efca2b1c06b20dfb33 Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Thu, 23 Feb 2017 03:31:36 -0800 Subject: [PATCH] packager: node-haste: do not expose HasteMap Reviewed By: davidaurelio Differential Revision: D4598085 fbshipit-source-id: d993be8e3bdcfda018a898b4adb32b53c1f0a948 --- packages/metro-bundler/src/node-haste/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/metro-bundler/src/node-haste/index.js b/packages/metro-bundler/src/node-haste/index.js index 0357f7b4..c182ead5 100644 --- a/packages/metro-bundler/src/node-haste/index.js +++ b/packages/metro-bundler/src/node-haste/index.js @@ -81,7 +81,7 @@ class DependencyGraph { _helpers: DependencyGraphHelpers; _moduleCache: ModuleCache; - _loading: Promise; + _loading: Promise; constructor(opts: Options) { this._opts = {...opts}; @@ -89,7 +89,7 @@ class DependencyGraph { this.load(); } - load() { + load(): Promise { 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 => {