mozilla/sweet.js — pull request #176 by natefaubion (2014-01-04 13:23:41+00:00)
Title: Make destruct pure.

I had added a `destructed` return value from `enforest` to get around the fact that `destruct` wasn't pure, but it was naive and problematic (it took the diff from `toks` and `rest`). I need to get the destructed syntax of the term to push onto `prevStx`. Since `destruct` mutated it's sources, it couldn't be called more than once on a term. This PR makes `destruct` pure by making copies in the cases where it used mutation, and removes the `destructed` reference from `enforest`.