We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7dc999f commit 5d76493Copy full SHA for 5d76493
tools/server/public_simplechat/xpromise.mjs
@@ -15,6 +15,8 @@
15
*/
16
export async function evalWithPromiseTracking(codeToEval) {
17
const _Promise = globalThis.Promise;
18
+ const _fetch = globalThis.fetch
19
+
20
/** @type {any[]} */
21
const trackedPromises = [];
22
@@ -43,6 +45,13 @@ export async function evalWithPromiseTracking(codeToEval) {
43
45
Promise.prototype = _Promise.prototype;
44
46
Object.assign(Promise, _Promise);
47
48
+ const fetch = function(/** @type {any[]} */ ...args) {
49
+ console.info("WW:PT:Fetch")
50
+ const fpromise = _fetch(args);
51
+ trackedPromises.push(fpromise)
52
+ return fpromise;
53
+ }
54
55
eval(codeToEval);
56
57
//await Promise(resolve=>setTimeout(resolve, 0));
0 commit comments