You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
If I run the script below, timeouts after Promise.resolve() are ignored while calculation timeout for the poll phase if the queue is empty.
The timeout callbacks declared inside then body of Promise.resolve() will be called if anything else will stop poll waiting (for example, another setTimeout).
However, their timeout values will have no impact on the poll phase timeout.
constgetCurrentTime=function(){consttoday=newDate();return`${today.getHours()}:${today.getMinutes()}:${today.getSeconds()}:${today.getMilliseconds()}`;}console.info(`${getCurrentTime()}|Start`);// global timeoutsetTimeout(()=>{console.info(`${getCurrentTime()}|5s-timeout ended`);},5000);setTimeout(()=>{Promise.resolve().then(()=>{console.info(`${getCurrentTime()}|Promise has been resolved`);consttimerStartTime=process.hrtime();// The callback will be run after the global timeoutsetTimeout(()=>{consttimeoutActualStart=process.hrtime(timerStartTime);console.info(`${getCurrentTime()}|0ms-timeout started after ${timeoutActualStart}s`);});// The callback will be run after the global timeoutsetTimeout(()=>{consttimeoutActualStart=process.hrtime(timerStartTime);console.info(`${getCurrentTime()}|1s-timeout started after ${timeoutActualStart}s`);},1000);});});
The issue can be only reproduced while using electron with ELECTRON_RUN_AS_NODE activated. The issue cannot be reproduced if I run the same script using nodejs v12.13.0.
Electron version on my PC is v8.0.0 (originally the issue was reproduced on v7.1.11).