diff --git a/src/compile/nodes/EachBlock.ts b/src/compile/nodes/EachBlock.ts index 74a58fff38..2842ba684f 100644 --- a/src/compile/nodes/EachBlock.ts +++ b/src/compile/nodes/EachBlock.ts @@ -16,7 +16,7 @@ function unpack_destructuring(contexts: Array<{ name: string, tail: string }>, n }); } else if (node.type === 'ArrayPattern') { node.elements.forEach((element, i) => { - if (element.type === 'RestIdentifier') { + if (element && element.type === 'RestIdentifier') { unpack_destructuring(contexts, element, `${tail}.slice(${i})`) } else { unpack_destructuring(contexts, element, `${tail}[${i}]`);