From ba88046c2473b02b4ea9752a01d147a41fc75b44 Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Wed, 22 Mar 2017 11:47:46 -0700 Subject: [PATCH] packager: Package.js: cover the error cases Summary: In case the sync function throws, it wouldn't be handled through the promise anymore, that is not what we want. So we revert that in this changeset. Reviewed By: davidaurelio Differential Revision: D4754740 fbshipit-source-id: 4da360f4b629bbdf9cd284389060429cc9259c2c --- packages/metro-bundler/src/node-haste/Package.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/metro-bundler/src/node-haste/Package.js b/packages/metro-bundler/src/node-haste/Package.js index fa5bb05b..34456563 100644 --- a/packages/metro-bundler/src/node-haste/Package.js +++ b/packages/metro-bundler/src/node-haste/Package.js @@ -67,13 +67,13 @@ class Package { isHaste() { return this._cache.get(this.path, 'package-haste', () => - Promise.resolve(!!this.read().name) + Promise.resolve().then(() => !!this.read().name) ); } getName(): Promise { return this._cache.get(this.path, 'package-name', () => - Promise.resolve(this.read().name) + Promise.resolve().then(() => this.read().name) ); }