Skip to content

Commit 09298a2

Browse files
Release 5.16.1 (#185)
1 parent 2c15995 commit 09298a2

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

lib/core/constants.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ const definitions = [
2727

2828
const constants = {
2929
helpUrlBase: 'https://dequeuniversity.com/rules/',
30+
// Size of a grid square in pixels
3031
gridSize: 200,
32+
// At a certain point, looping over an array of elements and using .match on them
33+
// is slower than just running querySelectorAll again.
3134
selectorSimilarFilterLimit: 700,
3235
results: [],
3336
resultGroups: [],
@@ -44,7 +47,15 @@ const constants = {
4447
timeout: 10000
4548
}),
4649
allOrigins: '<unsafe_all_origins>',
47-
sameOrigin: '<same_origin>'
50+
sameOrigin: '<same_origin>',
51+
serializableErrorProps: Object.freeze([
52+
'message',
53+
'stack',
54+
'name',
55+
'code',
56+
'ruleId',
57+
'method'
58+
])
4859
};
4960

5061
definitions.forEach(definition => {

lib/core/utils/performance-timer.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,27 @@ const performanceTimer = (() => {
7373
* @param {String} endMark String name of mark to end measuring
7474
*/
7575
measure(measureName, startMark, endMark, details = {}) {
76-
if (window.performance && window.performance.measure !== undefined) {
77-
if (Object.keys(details).length > 0) {
78-
const measureOpts = {
79-
detail: details,
80-
start: startMark,
81-
end: endMark
82-
};
83-
window.performance.measure(measureName, measureOpts);
84-
} else {
85-
window.performance.measure(measureName, startMark, endMark);
76+
try {
77+
if (window.performance && window.performance.measure !== undefined) {
78+
if (Object.keys(details).length > 0) {
79+
const measureOpts = {
80+
detail: details,
81+
start: startMark,
82+
end: endMark
83+
};
84+
window.performance.measure(measureName, measureOpts);
85+
} else {
86+
window.performance.measure(measureName, startMark, endMark);
87+
}
8688
}
89+
} catch (err) {
90+
// NOTE: Performance metrics will be missed if an error occurs here
91+
a11yEngine.errorHandler.addNonCheckError(
92+
'INSTRUMENTATION_ERROR',
93+
'AxeCore PerformanceTimer measure Error',
94+
err,
95+
true
96+
);
8797
}
8898
},
8999
/**

0 commit comments

Comments
 (0)