Closed jbt closed 7 years ago
From the following example:
if (a) { if (b) { c; } else { // empty / comented out } }
Coming from inside BlockStatement: https://github.com/Rich-Harris/butternut/blob/6f83a370a170bfd8b7793400c57bb9266e26a05f/src/program/BlockStatement.js#L112
Adding if (this.body.length === 0) return this; at the top of BlockStatement's getLeft/RightHandSide seems to fix it up fine and tests all pass, not sure whether I'm missing something though.
if (this.body.length === 0) return this;
BlockStatement
fixed in 0.4.4, thanks
From the following example:
Coming from inside BlockStatement: https://github.com/Rich-Harris/butternut/blob/6f83a370a170bfd8b7793400c57bb9266e26a05f/src/program/BlockStatement.js#L112
Adding
if (this.body.length === 0) return this;
at the top ofBlockStatement
's getLeft/RightHandSide seems to fix it up fine and tests all pass, not sure whether I'm missing something though.