Index: src/js/promise.js |
diff --git a/src/js/promise.js b/src/js/promise.js |
index 48ed821373063185c2c288881bb3296a22facfcc..11d6622a663d0aa9e19fcea77b8dd1741472417f 100644 |
--- a/src/js/promise.js |
+++ b/src/js/promise.js |
@@ -394,9 +394,8 @@ function PromiseRace(iterable) { |
var deferred = NewPromiseCapability(this); |
try { |
for (var value of iterable) { |
- var reject = reason => { deferred.reject(reason); }; |
- this.resolve(value).then((x) => { deferred.resolve(x) }, reject); |
- SET_PRIVATE(reject, promiseCombinedDeferredSymbol, deferred); |
+ this.resolve(value).then(deferred.resolve, deferred.reject); |
+ SET_PRIVATE(deferred.reject, promiseCombinedDeferredSymbol, deferred); |
} |
} catch (e) { |
deferred.reject(e) |