| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
|
Nice catch! |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #51673 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #51673 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
| Back | FazBrowse Home | New Git URL |
Fixes calling clearTimeout in a mocked setTimeout callback resulting in two timeouts being removed from the execution queue (the current timeout and the next one in the queue). This happens because clearTimeout removes the timeout at execution queue position 1, followed by the call in tick() to #executionQueue.shift() removing the next item in the queue.
I fixed this by checking if the first item in the execution queue has the same ID as the one that is being executed before calling #executionQueue.shift(). If the IDs aren't the same, it means it was already removed by a call to clearTimeout in the callback.