substack/js-traverse — pull request #21 by grncdr (2012-05-02 18:51:47+00:00)
Title: Fix crash when node is a string and this.update is called with an object.

If you replace a string with an object, traverse crashes because state.keys is still set to null. This fixes the crash, but it will likely cause other problems, It seems to me that the chunk of code between 163 and 177 should be made into a function that is called before cb() and after state.update(), but I wanted to make sure I wasn't confused about update()'s intended behaviour before going that far.