aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-05-24 13:39:50 -0400
committerGitHub <noreply@github.com>2020-05-24 13:39:50 -0400
commitc800444a0d4aa0177242da51e0f9716ebe882587 (patch)
treebffed30a50711bac34a41c2436d54326ee45e1b6
parent3089bb7908e42e9101241476f700033df82e685d (diff)
Ensure the return value of promiseTimeout always has .resolve and .reject (#550)
-rw-r--r--ext/mixed/js/core.js5
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;