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

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

@ -92,9 +92,11 @@ 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.elements.length node.expression.node.type === 'ArrayExpression' &&
: null; node.expression.node.elements.every(element => element.type !== 'SpreadElement')
? node.expression.node.elements.length
: null;
// hack the sourcemap, so that if data is missing the bug // hack the sourcemap, so that if data is missing the bug
// is easy to find // is easy to find

Loading…
Cancel
Save