using for loop instead of forEach in element classlists

pick #64 and close #68
This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent c09ee435d8
commit 7cb4a25597

View File

@@ -183,11 +183,13 @@ export function _isBlockedElement(
return true;
}
} else {
element.classList.forEach((className) => {
// tslint:disable-next-line: prefer-for-of
for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {
const className = element.classList[eIndex];
if (blockClass.test(className)) {
return true;
}
});
}
}
if (blockSelector) {
return element.matches(blockSelector);