From 749f6a69cdd11ce7f466205357c73e21c52df359 Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Fri, 3 Apr 2015 15:46:59 -0700 Subject: [PATCH] [react-packager] Don't cache rejected promise --- packager/react-packager/src/JSTransformer/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packager/react-packager/src/JSTransformer/index.js b/packager/react-packager/src/JSTransformer/index.js index fde8336e0..abfae2482 100644 --- a/packager/react-packager/src/JSTransformer/index.js +++ b/packager/react-packager/src/JSTransformer/index.js @@ -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;