mirror of https://github.com/status-im/metro.git
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
This commit is contained in:
parent
51b44a5b52
commit
ba88046c24
|
@ -67,13 +67,13 @@ class Package {
|
||||||
|
|
||||||
isHaste() {
|
isHaste() {
|
||||||
return this._cache.get(this.path, 'package-haste', () =>
|
return this._cache.get(this.path, 'package-haste', () =>
|
||||||
Promise.resolve(!!this.read().name)
|
Promise.resolve().then(() => !!this.read().name)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getName(): Promise<string> {
|
getName(): Promise<string> {
|
||||||
return this._cache.get(this.path, 'package-name', () =>
|
return this._cache.get(this.path, 'package-name', () =>
|
||||||
Promise.resolve(this.read().name)
|
Promise.resolve().then(() => this.read().name)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue