From c800444a0d4aa0177242da51e0f9716ebe882587 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 24 May 2020 13:39:50 -0400 Subject: [PATCH] Ensure the return value of promiseTimeout always has .resolve and .reject (#550) --- ext/mixed/js/core.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;