From 98849882a212dc86581b0ae89d89ba62d5e6eb00 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Sat, 6 Sep 2025 08:15:30 -0700 Subject: [PATCH] rm TODO comment about integrating detectLateRejectionHandling with clearStack In theory, resetting clearStack's inline call count every time late rejection handling does a setTimeout should reduce the performance penalty in some environments. In practice, it doesn't: * In Chrome and FF, late rejection handling has no measurable penalty. * In Safari, resetting the inline call count actually slows things down considerably(!). * In Node, clearStack doesn't use setTimeout so there is no benefit. --- lib/jasmine-core/jasmine.js | 1 - src/core/TreeRunner.js | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index f1b79721..10e4d900 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -11614,7 +11614,6 @@ getJasmineRequireObj().TreeRunner = function(j$) { return { fn: done => { // setTimeout is necessary to trigger rejectionhandled events - // TODO: let clearStack know about this so it doesn't do redundant setTimeouts this.#setTimeout(function() { globalErrors.reportUnhandledRejections(); done(); diff --git a/src/core/TreeRunner.js b/src/core/TreeRunner.js index 5952739f..1a84a59a 100644 --- a/src/core/TreeRunner.js +++ b/src/core/TreeRunner.js @@ -192,7 +192,6 @@ getJasmineRequireObj().TreeRunner = function(j$) { return { fn: done => { // setTimeout is necessary to trigger rejectionhandled events - // TODO: let clearStack know about this so it doesn't do redundant setTimeouts this.#setTimeout(function() { globalErrors.reportUnhandledRejections(); done();