Chrome と Firefox で console.log が少し違う
- Chrome 21.0.1180.75 beta, 22.0.1229.0 canary
- Firefox 14.0.1
var header = document.getElementById('header')
header.addEventListener('click', console.log, false)
が Chrome だと
Uncaught TypeError: Illegal invocation
になってしまう。Firefox だと問題ないし、Chrome でも
header.addEventListener('click', function (e) { console.log(e) }, false)
だと問題ない。console.log の中身は Chrome では
> console.log.toString()
"function log() { [native code] }"
で、Firefox では
> console.log.toString()
"function () {
return Function.apply.call(x.log, x, arguments);
}"
になってる。