{"ScriptPreparationCode":"// language=HTML\r\nconst html = \u0060\r\n \u003C!-- article out start --\u003E\r\n \u003Carticle\u003E\r\n \u003C!-- article in start --\u003E\r\n \u003Ch1\u003ELorem ipsum\u003C/h1\u003E\r\n \u003Cp\u003ELorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, nostrum.\u003C/p\u003E\r\n \u003C!-- article in end --\u003E\r\n \u003C/article\u003E\r\n \u003C!-- article out end --\u003E\r\n\r\n \u003C!-- article out start --\u003E\r\n \u003Carticle\u003E\r\n \u003C!-- article in start --\u003E\r\n \u003Ch1\u003ELorem ipsum\u003C/h1\u003E\r\n \u003Cp\u003ELorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, nostrum.\u003C/p\u003E\r\n \u003C!-- article in end --\u003E\r\n \u003C/article\u003E\r\n \u003C!-- article out end --\u003E\r\n\r\n \u003C!-- article out start --\u003E\r\n \u003Carticle\u003E\r\n \u003C!-- article in start --\u003E\r\n \u003Ch1\u003ELorem ipsum\u003C/h1\u003E\r\n \u003Cp\u003ELorem ipsum dolor sit amet, consectetur adipisicing elit. Cumque, nostrum.\u003C/p\u003E\r\n \u003C!-- article in end --\u003E\r\n \u003C/article\u003E\r\n \u003C!-- article out end --\u003E\r\n\u0060;\r\nconst template = document.createElement(\u0027template\u0027);\r\ntemplate.innerHTML = html;\r\n\r\nwindow.testTemplate = template;\r\nwindow.dom_traverse = function dom_traverse(tip, nodeType, fn_use) {\r\n let ch\r\n while (tip) {\r\n if (nodeType === tip.nodeType)\r\n fn_use(tip);\r\n\r\n if (ch = tip.firstChild)\r\n dom_traverse(ch, fn_use);\r\n\r\n tip = tip.nextSibling;\r\n }\r\n}\r\n","TestCases":[{"Name":"NodeIterator with filter param","Code":"const nodeIterator = document.createNodeIterator(\r\n testTemplate.content,\r\n NodeFilter.SHOW_COMMENT\r\n);\r\n\r\nconst comments = [];\r\nwhile (nodeIterator.nextNode()) {\r\n comments.push(nodeIterator.currentNode);\r\n}","IsDeferred":false},{"Name":"TreeWalker with filter param","Code":"const treeWalker = document.createTreeWalker(\r\n testTemplate.content,\r\n NodeFilter.SHOW_COMMENT\r\n);\r\n\r\nconst comments = [];\r\nwhile (treeWalker.nextNode()) {\r\n comments.push(treeWalker.currentNode);\r\n}","IsDeferred":false},{"Name":"Traverse filter function","Code":"const comments = [];\r\ndom_traverse(testTemplate.content, Node.COMMENT_NODE, node =\u003E {\r\n comments.push(node);\r\n});","IsDeferred":false}]}