Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var current = pending.shift();
while (current) {
if (memory.indexOf(current) < 0) {
memory.push(current);
if (current.children && !isItem(current)) {
pending = pending.concat(current.children);
}
var props = getPropertyNames(current);
if (props.length > 0) {
results.push(current);
}
}
current = pending.shift();
}
results.sort(DOM.compareDocumentPosition);
return results;
}