From 74f679e8bd07530191aba4a211421abc49a9dcd1 Mon Sep 17 00:00:00 2001 From: Sajal Garg Date: Wed, 14 Jan 2026 17:25:33 +0530 Subject: [PATCH 1/4] Added Error Handler --- lib/core/utils/performance-timer.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lib/core/utils/performance-timer.js b/lib/core/utils/performance-timer.js index 5b26c858..62d3db9f 100644 --- a/lib/core/utils/performance-timer.js +++ b/lib/core/utils/performance-timer.js @@ -73,17 +73,26 @@ const performanceTimer = (() => { * @param {String} endMark String name of mark to end measuring */ measure(measureName, startMark, endMark, details = {}) { - if (window.performance && window.performance.measure !== undefined) { - if (Object.keys(details).length > 0) { - const measureOpts = { - detail: details, - start: startMark, - end: endMark - }; - window.performance.measure(measureName, measureOpts); - } else { - window.performance.measure(measureName, startMark, endMark); + try { + if (window.performance && window.performance.measure !== undefined) { + if (Object.keys(details).length > 0) { + const measureOpts = { + detail: details, + start: startMark, + end: endMark + }; + window.performance.measure(measureName, measureOpts); + } else { + window.performance.measure(measureName, startMark, endMark); + } } + } catch (err) { + // NOTE: Performance metrics will be missed if an error occurs here + a11yEngine.errorHandler.addNonCheckError( + 'INSTRUMENTATION_ERROR', + 'AxeCore PerformanceTimer measure Error', + err + ); } }, /** From 389078fd38bdb350b6ab6e4324db1b1c6420d39f Mon Sep 17 00:00:00 2001 From: Sajal Garg Date: Wed, 14 Jan 2026 18:46:38 +0530 Subject: [PATCH 2/4] Fix EDS event error --- lib/core/utils/performance-timer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/utils/performance-timer.js b/lib/core/utils/performance-timer.js index 62d3db9f..1ee71a2b 100644 --- a/lib/core/utils/performance-timer.js +++ b/lib/core/utils/performance-timer.js @@ -91,7 +91,8 @@ const performanceTimer = (() => { a11yEngine.errorHandler.addNonCheckError( 'INSTRUMENTATION_ERROR', 'AxeCore PerformanceTimer measure Error', - err + err, + true ); } }, From aa6d83787a0e92d709bc0bcb19ca752627a8a73e Mon Sep 17 00:00:00 2001 From: Sajal Garg Date: Thu, 15 Jan 2026 10:33:14 +0530 Subject: [PATCH 3/4] Updated constants.js with serializableErrorProps --- lib/core/constants.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/core/constants.js b/lib/core/constants.js index 71918e37..dec74111 100644 --- a/lib/core/constants.js +++ b/lib/core/constants.js @@ -44,7 +44,15 @@ const constants = { timeout: 10000 }), allOrigins: '', - sameOrigin: '' + sameOrigin: '', + serializableErrorProps: Object.freeze([ + 'message', + 'stack', + 'name', + 'code', + 'ruleId', + 'method' + ]) }; definitions.forEach(definition => { From 0036065647ad9205b7df15a3ef2f433d5591c9dd Mon Sep 17 00:00:00 2001 From: Sajal Garg Date: Thu, 15 Jan 2026 10:37:16 +0530 Subject: [PATCH 4/4] Kept comments same for consistency --- lib/core/constants.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/constants.js b/lib/core/constants.js index dec74111..c5b9fd2b 100644 --- a/lib/core/constants.js +++ b/lib/core/constants.js @@ -27,7 +27,10 @@ const definitions = [ const constants = { helpUrlBase: 'https://dequeuniversity.com/rules/', + // Size of a grid square in pixels gridSize: 200, + // At a certain point, looping over an array of elements and using .match on them + // is slower than just running querySelectorAll again. selectorSimilarFilterLimit: 700, results: [], resultGroups: [],