This turned out to be tricky to figure out, as it had to do with the generator! ArrayBindingPattern nodes have a length field which was zero in this case. We could instead remove length fields from AST node objects, but it seems like a useful field name (I'd rather have it defined for ObjectBindingPattern too so that code could be more symmetric), and maybe used a fair amount around array patterns, so changing the generator seemed better. Note that empty arrays are still also removed, using the code down below.
Fix the issue mentioned here: https://github.com/DanielXMoore/Civet/pull/1200#discussion_r1583864309
This turned out to be tricky to figure out, as it had to do with the generator! ArrayBindingPattern nodes have a
length
field which was zero in this case. We could instead removelength
fields from AST node objects, but it seems like a useful field name (I'd rather have it defined for ObjectBindingPattern too so that code could be more symmetric), and maybe used a fair amount around array patterns, so changing the generator seemed better. Note that empty arrays are still also removed, using the code down below.