diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-05-24 13:39:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 13:39:50 -0400 |
commit | c800444a0d4aa0177242da51e0f9716ebe882587 (patch) | |
tree | bffed30a50711bac34a41c2436d54326ee45e1b6 /ext/mixed | |
parent | 3089bb7908e42e9101241476f700033df82e685d (diff) |
Ensure the return value of promiseTimeout always has .resolve and .reject (#550)
Diffstat (limited to 'ext/mixed')
-rw-r--r-- | ext/mixed/js/core.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js index 4c22cae7..257c7edf 100644 --- a/ext/mixed/js/core.js +++ b/ext/mixed/js/core.js @@ -164,7 +164,10 @@ function getSetDifference(set1, set2) { function promiseTimeout(delay, resolveValue) { if (delay <= 0) { - return Promise.resolve(resolveValue); + const promise = Promise.resolve(resolveValue); + promise.resolve = () => {}; // NOP + promise.reject = () => {}; // NOP + return promise; } let timer = null; |