unassert-js / unassert

Encourages programming with assertions by providing tools to compile them away.
MIT License
192 stars 13 forks source link

fix: unassert causes SyntaxError when body of LabeledStatement is single ExpressionStatement #37

Closed twada closed 2 years ago

twada commented 2 years ago

Body of LabeledStatement or WithStatement can be single ExpressionStatement and causes SyntaxError when removed. So instead of removing it, replace it with empty BlockStatement.