Skip to content

Commit 024fd30

Browse files
committed
Added node count
1 parent 83f7cca commit 024fd30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/core/base/rule.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from '../utils';
1313
import { isVisibleToScreenReaders } from '../../commons/dom';
1414
import constants from '../constants';
15+
import cache from './cache';
1516

1617
export default function Rule(spec, parentAudit) {
1718
this._audit = parentAudit;
@@ -245,6 +246,7 @@ Rule.prototype.run = function run(context, options = {}, resolve, reject) {
245246
try {
246247
// Matches throws an error when it lacks support for document methods
247248
nodes = this.gatherAndMatchNodes(context, options);
249+
cache.set(this.id, nodes.length);
248250
} catch (error) {
249251
// Exit the rule execution if matches fails
250252
reject(new SupportError({ cause: error, ruleId: this.id }));

0 commit comments

Comments
 (0)