File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
tools/server/public_simplechat Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export async function evalWithPromiseTracking(codeToEval) {
2525 const promise = new _Promise ( executor ) ;
2626 trackedPromises . push ( promise ) ;
2727
28+ // @ts -ignore
2829 promise . then = function ( ...args ) {
2930 console . info ( "WW:PT:Then" )
3031 const newPromise = _Promise . prototype . then . apply ( this , args ) ;
@@ -47,12 +48,15 @@ export async function evalWithPromiseTracking(codeToEval) {
4748
4849 const fetch = function ( /** @type {any[] } */ ...args ) {
4950 console . info ( "WW:PT:Fetch" )
51+ // @ts -ignore
5052 const fpromise = _fetch ( args ) ;
5153 trackedPromises . push ( fpromise )
5254 return fpromise ;
5355 }
5456
55- eval ( codeToEval ) ;
57+ //let tf = new Function(codeToEval);
58+ //await tf()
59+ await eval ( `(async () => { ${ codeToEval } })()` ) ;
5660
5761 //await Promise(resolve=>setTimeout(resolve, 0));
5862 //return _Promise.allSettled(trackedPromises);
You can’t perform that action at this time.
0 commit comments