Fix NPE on pattern check

pull/2658/head
Michael Braun 6 years ago
parent c477f50b9a
commit f69f46c461

@ -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}]`);

Loading…
Cancel
Save