if (true) {
function test() {
console.log(true);
}
} else {
function test() {
console.log(false);
}
}
test()
Chrome 48 (and node <5.9.1) logs false, chrome 49 (and firefox) log true. I guess they optimized by not hoisting from the falsy branch, but that can break existing applications.
Which one is correct according to spec?