mikeal/request — pull request #388 by othiym23 (2012-12-08 05:31:07+00:00)
Title: Ensure "safe" toJSON doesn't break EventEmitters

V8 and / or the JS spec are apparently extremely wily about interpreting values as potential indexes for arrays -- even hex strings can be converted internally back to numbers when passed to Object.defineProperty(). This should fix mikeal/request#387.

None of the tests break with this change, but as the bug is sort of a race condition, I couldn't easily come up with a new test case. The breaking test code on mikeal/request#387 no longer crashes when left running for a decent length of time, at least.