WRT formatting, a lot of JS coders think you should always begin your curly braces on the same line as the statement, not on the next, or you risk the wrath of automatic semicolon insertion. The formatter seems fine if you do it this way, and it's also a generally good idea to avoid bizarre, hard to track down bugs.
But I'd understand if that's not an acceptable answer for you.
But I'd understand if that's not an acceptable answer for you.