Closed goto-bus-stop closed 6 years ago
Added the test I mentioned in the OP, and benchmarks too.
Surprisingly this is actually significantly faster than before. some crude profiling shows that a lot of time was being spent by falafel walking the tree, and adding helper methods to each node. static-module never added those helper methods. This PR uses acorn's AST walker instead, which is much faster; "much enough" to offset the cost of scope analysis :smile_cat:
Module declarations are only removed if all references to those modules were removed.
The changed tests are only to account for slight output differences re: whitespaces and semicolons.
Need to add some tests still for things like:
Closes #4 Closes #12 Closes #17 Closes #22 Ref https://github.com/browserify/brfs/issues/71 Ref https://github.com/browserify/brfs/issues/76