[react-packager] Don't cache rejected promise

This commit is contained in:
Amjad Masad 2015-04-03 15:46:59 -07:00
parent 34ed3a0cec
commit 749f6a69cd
1 changed files with 3 additions and 5 deletions

View File

@ -61,9 +61,7 @@ function Transformer(options) {
projectRoots: options.projectRoots,
});
if (options.transformModulePath == null) {
this._failedToStart = Promise.reject(new Error('No transfrom module'));
} else {
if (options.transformModulePath != null) {
this._workers = workerFarm(
{autoStart: true, maxConcurrentCallsPerWorker: 1},
options.transformModulePath
@ -83,8 +81,8 @@ Transformer.prototype.invalidateFile = function(filePath) {
};
Transformer.prototype.loadFileAndTransform = function(filePath) {
if (this._failedToStart) {
return this._failedToStart;
if (this._transform == null) {
return Promise.reject(new Error('No transfrom module'));
}
var transform = this._transform;