Skip to content

Commit

Permalink
Move the rule defer to after the perf log
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers committed Oct 28, 2024
1 parent a453b00 commit d769ba8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/core/base/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ Rule.prototype.run = function run(context, options = {}, resolve, reject) {
});
});

// Defer the rule's execution to prevent "unresponsive script" warnings.
// See https://github.com/dequelabs/axe-core/pull/1172 for discussion and details.
q.defer(res => setTimeout(res, 0));

q.then(() => {
if (options.performanceTimer) {
this._logRulePerformance();
}
resolve(ruleResult);
// Defer the rule's execution to prevent "unresponsive script" warnings.
// See https://github.com/dequelabs/axe-core/pull/1172 for discussion and details.
setTimeout(() => {
resolve(ruleResult);
}, 0);
}).catch(error => {
if (options.performanceTimer) {
this._logRulePerformance();
Expand Down

0 comments on commit d769ba8

Please sign in to comment.