Fix crash when exporting with destructuring and sparse array (#170)

* Create reproducible crash when exporting with destructuring and sparse array

* Fix crash when exporting with destructuring and sparse array
This commit is contained in:
Jeroen Engels
2016-10-13 01:36:08 +02:00
committed by Henry Zhu
parent b1fc65530d
commit e14f93d1bb
3 changed files with 162 additions and 7 deletions

View File

@@ -943,7 +943,9 @@ pp.checkDeclaration = function(node) {
}
} else if (node.type === "ArrayPattern") {
for (let elem of node.elements) {
this.checkDeclaration(elem);
if (elem) {
this.checkDeclaration(elem);
}
}
} else if (node.type === "ObjectProperty") {
this.checkDeclaration(node.value);