Fix NPE on pattern check

pull/7738/head
Michael Braun 7 years ago
parent aa6e612bf0
commit 5bcba3b388

@ -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