cfpb/amortize — pull request #6 by contolini (2014-08-29 23:53:34+00:00)
Title: Improve object iteration garbage collection

This bug took far longer than I'd like to admit to track down and all of five minutes to fix. When [OAH](https://github.com/cfpb/owning-a-home) started crashing in IE8 I assumed it had to do with one of the recent polyfills we added or some rogue recursive event handling. Turns out, it was the seemingly harmless `roundNum` function in the `amortize` module returning an argument after adding properties to it which apparently causes IE8 to round up all the memory it can find, tie it up in the corner and burn the entire &@%$ing house down.

Here's a reduced test case: http://jsfiddle.net/contolini/5eqfoxqb/

![ie8](https://cloud.githubusercontent.com/assets/1060248/4097453/d7b3fc50-2fd5-11e4-9d47-96ff60f39765.gif)

The lesson here is that it's important we run our automated unit tests in *real browsers* instead of just node. We had testling set up but due to its frequent downtime it's virtually useless. We need to wire either sauce or browserstack into our [generator](https://github.com/cfpb/generator-node-cfpb).