Skip to content

Commit

Permalink
Convert querySelectorAll result to array before iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Mar 17, 2018
1 parent 5da6336 commit ead5172
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ module.exports = async function (options, t) {
if (asset.type === 'Html' || asset.type === 'Svg') {
// Remember the set of ids in the document before unloading so incoming fragments can be checked:
asset.ids = new Set();
for (const element of asset.parseTree.querySelectorAll('[id]')) {
for (const element of Array.from(asset.parseTree.querySelectorAll('[id]'))) {
asset.ids.add(element.getAttribute('id'));
}
}
Expand Down

0 comments on commit ead5172

Please sign in to comment.