rebuild symbols and scopes to keep everything in sync
// We have to re-create the symbol table and scope tree after the transformation so far to make sure they are up-to-date.
let (symbols, scopes) = ast.make_symbol_table_and_scope_tree();
I think https://github.com/oxc-project/oxc/issues/4790 is key to this. If we build that testing setup for transformer, we can also use it for minifier, DCE, etc to make sure they're all behaving.
Rolldown currently runs semantic builder numerous times to keep symbols and scopes in sync:
https://github.com/rolldown/rolldown/blob/main/crates/rolldown/src/utils/pre_process_ecma_ast.rs
And then eventually on the chunk level: