|
|
@ -2,6 +2,7 @@ import deindent from '../../../utils/deindent';
|
|
|
|
import visit from '../visit';
|
|
|
|
import visit from '../visit';
|
|
|
|
import { DomGenerator } from '../index';
|
|
|
|
import { DomGenerator } from '../index';
|
|
|
|
import Block from '../Block';
|
|
|
|
import Block from '../Block';
|
|
|
|
|
|
|
|
import isDomNode from './shared/isDomNode';
|
|
|
|
import { Node } from '../../../interfaces';
|
|
|
|
import { Node } from '../../../interfaces';
|
|
|
|
import { State } from '../interfaces';
|
|
|
|
import { State } from '../interfaces';
|
|
|
|
|
|
|
|
|
|
|
@ -19,7 +20,7 @@ export default function visitEachBlock(
|
|
|
|
const iterations = block.getUniqueName(`${each_block}_iterations`);
|
|
|
|
const iterations = block.getUniqueName(`${each_block}_iterations`);
|
|
|
|
const params = block.params.join(', ');
|
|
|
|
const params = block.params.join(', ');
|
|
|
|
|
|
|
|
|
|
|
|
const needsAnchor = node.next ? (!node.next._state || !node.next.var) : !state.parentNode;
|
|
|
|
const needsAnchor = node.next ? !isDomNode(node.next) : !state.parentNode;
|
|
|
|
const anchor = needsAnchor
|
|
|
|
const anchor = needsAnchor
|
|
|
|
? block.getUniqueName(`${each_block}_anchor`)
|
|
|
|
? block.getUniqueName(`${each_block}_anchor`)
|
|
|
|
: (node.next && node.next.var) || 'null';
|
|
|
|
: (node.next && node.next.var) || 'null';
|
|
|
|