cfpb / amortize

A node module to calculate the interest paid, principal paid, remaining balance, and monthly payment of a loan.
Creative Commons Zero v1.0 Universal
58 stars 19 forks source link

Improve object iteration garbage collection #6

Closed contolini closed 10 years ago

contolini commented 10 years ago

This bug took far longer than I'd like to admit to track down and all of five minutes to fix. When OAH 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 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/2

ie8

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.

ascott1 commented 10 years ago