Skip to content

Commit d614f95

Browse files
committed
fixes webpack#136
1 parent 4b9472b commit d614f95

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/Parser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ Parser.prototype.walkVariableDeclarators = function walkVariableDeclarators(decl
469469

470470
Parser.prototype.walkExpressions = function walkExpressions(expressions) {
471471
expressions.forEach(function(expression) {
472-
this.walkExpression(expression);
472+
if(expression)
473+
this.walkExpression(expression);
473474
}, this);
474475
}
475476

test/browsertest/lib/index.web.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ describe("main", function() {
240240
a.should.be.eql("a");
241241
});
242242
});
243+
244+
it("should parse sparse arrays", function() { // issue #136
245+
[,null].should.have.length(2);
246+
[0,,,0].should.have.length(4);
247+
});
243248
});
244249

245250
describe("polyfilling", function() {

0 commit comments

Comments
 (0)