skip array literal length optimization in presence of spread (#2325)

pull/2326/head
Conduitry 6 years ago
parent e527b0424a
commit ecea85891c

@ -92,7 +92,9 @@ export default class EachBlockWrapper extends Wrapper {
this.index_name = this.node.index || renderer.component.get_unique_name(`${this.node.context}_index`); this.index_name = this.node.index || renderer.component.get_unique_name(`${this.node.context}_index`);
const fixed_length = node.expression.node.type === 'ArrayExpression' const fixed_length =
node.expression.node.type === 'ArrayExpression' &&
node.expression.node.elements.every(element => element.type !== 'SpreadElement')
? node.expression.node.elements.length ? node.expression.node.elements.length
: null; : null;

Loading…
Cancel
Save