File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ const globalObject = require("@sinonjs/commons").global;
109109 * @property {number } createdAt
110110 * @property {boolean } immediate
111111 * @property {number } id
112+ * @property {Error } [error]
112113 */
113114
114115/**
@@ -208,8 +209,8 @@ function withGlobal(_global) {
208209 let isNearInfiniteLimit = false ;
209210
210211 /**
211- * @param clock
212- * @param i
212+ * @param { Clock } clock
213+ * @param { number } i
213214 */
214215 function checkIsNearInfiniteLimit ( clock , i ) {
215216 if ( clock . loopLimit && i === clock . loopLimit - 1 ) {
@@ -309,14 +310,18 @@ function withGlobal(_global) {
309310 }
310311
311312 /**
312- * @param clock
313- * @param job
313+ * @param { Clock } clock
314+ * @param { Timer } job
314315 */
315316 function getInfiniteLoopError ( clock , job ) {
316317 const infiniteLoopError = new Error (
317318 `Aborting after running ${ clock . loopLimit } timers, assuming an infinite loop!`
318319 ) ;
319320
321+ if ( ! job . error ) {
322+ return infiniteLoopError ;
323+ }
324+
320325 // pattern never matched in Node
321326 const computedTargetPattern = / t a r g e t \. * [ < | ( | [ ] .* ?[ > | \] | ) ] \s * / ;
322327 let clockMethodPattern = new RegExp (
You can’t perform that action at this time.
0 commit comments