dominictarr/reconnect — pull request #2 by JosephMoniz (2012-10-09 02:09:22+00:00)
Title: Dependency overwrites itself

On line [19 of inject.js](https://github.com/dominictarr/reconnect/blob/master/inject.js#L19) the backoff module is being overwritten by one of it's own methods. When the `inject()` method is called a subsequent time, the following TypeError is received

```
/Users/jmoniz/Dropbox/workspace/role-call/node_modules/reconnect/inject.js:19
backoff = (backoff[opts.type] || backoff.fibonacci) (opts)
^
TypeError: undefined is not a function
```

All you have to do to reproduce this error is have any node process create more then one reconnect() instances, the second one will throw the TypeError

To fix this i turned the backoff variable on line 19 into a local variable and one that doesn't conflict with the one in the global namespace.