From 504a54120f9d4bff730fba901f4638ebfe6fdf08 Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Tue, 11 Jul 2017 16:06:35 -0400 Subject: [PATCH] Fix bug in streamToPromise I don't know how we never noticed this, but unless I'm missing something, the `streamToPromise` helper we use in `gulpfile.js` would actually trigger failure in some cases instead of success. I think this might be why we have been seeing sporadic requirejs failures in travis builds but only on a very rare basis. --- gulpfile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index a629ab83bfab..86424949d6d0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1251,6 +1251,7 @@ function requirejsOptimize(name, config) { function streamToPromise(stream) { return new Promise(function(resolve, reject) { stream.on('finish', resolve); - stream.on('end', reject); + stream.on('end', resolve); + stream.on('error', reject); }); }