Rename local variable node and switch to for..of loop for blocks

pull/3679/head
Jesse Skinner 6 years ago
parent f305bba489
commit 03bf96e398

@ -148,14 +148,14 @@ function apply_selector(blocks: Block[], node: Node, stack: Node[], to_encapsula
if (block.combinator) { if (block.combinator) {
if (block.combinator.type === 'WhiteSpace') { if (block.combinator.type === 'WhiteSpace') {
for (let i = 0; i < blocks.length;i++) { for (let ancestorBlock of blocks) {
if (blocks[i].global) { if (ancestorBlock.global) {
continue; continue;
} }
stack.forEach(node => { stack.forEach(stackNode => {
if (block_might_apply_to_node(blocks[i], node)) { if (block_might_apply_to_node(ancestorBlock, stackNode)) {
to_encapsulate.push({ node, block: blocks[i] }); to_encapsulate.push({ node: stackNode, block: ancestorBlock });
} }
}); });

Loading…
Cancel
Save