Skip to content

Commit 5168e97

Browse files
authored
Merge pull request #15 from oslabs-beta/eva/nonexistentName
giving all ax nodes currently without a name a name
2 parents 5793383 + 3f92293 commit 5168e97

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/extension/background.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const metrics = {};
1818
const pruneAxTree = (axTree) => {
1919
const axArr = [];
2020
for (const node of axTree) {
21-
const {
21+
let {
2222
backendDOMNodeId,
2323
childIds,
2424
ignored,
@@ -29,6 +29,17 @@ const pruneAxTree = (axTree) => {
2929
properties,
3030
} = node;
3131

32+
if(!name){
33+
if(ignored){
34+
name = {value: `ignored node: ${ignoredReasons[0].name}`};
35+
}
36+
else{
37+
name = {value: 'visible node with no name'};
38+
}
39+
}
40+
if(!name.value){
41+
name.value = 'visible node with no name';
42+
}
3243
const axNode = {
3344
backendDOMNodeId: backendDOMNodeId,
3445
childIds: childIds,

0 commit comments

Comments
 (0)