Wouldn't it work properly before? JavaScript is function scoped, which means the curly braces on the if statement don't denote a new scope, and rather share the scope of their parent function.

Of course, it is still a bad thing to do, since most people expect it to be block scoped, as most other c-based languages are.