Skip to content

Commit e13b2c4

Browse files
committed
Reintroduce spread operator in aria-props-teset
1 parent 1e606bd commit e13b2c4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

__tests__/src/rules/aria-props-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import getSuggestion from '../../../src/util/getSuggestion';
1919
// -----------------------------------------------------------------------------
2020

2121
const ruleTester = new RuleTester();
22-
const ariaAttributes = aria.keys();
22+
const ariaAttributes = [...aria.keys()];
2323

2424
const errorMessage = (name) => {
2525
const suggestions = getSuggestion(name, ariaAttributes);

src/util/isSemanticRoleElement.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ const isSemanticRoleElement = (
3939
),
4040
)
4141
) {
42-
for (let k = 0; k < axObjects.length; k += 1) {
43-
const roles = AXObjectRoles.get(axObjects[k]);
42+
return axObjects.some((obj) => {
43+
const roles = AXObjectRoles.get(obj);
4444
if (roles && roles.some(
4545
(role) => role.name === roleAttrValue,
4646
)) {
4747
return true;
4848
}
49-
}
49+
return false;
50+
});
5051
}
5152
}
5253
return false;

0 commit comments

Comments
 (0)