This didn't work without binding up until, if I'm not mistaken, Node.js 8.x. I don't remember it causing any errors, if I remember correctly it used to silently fail (i.e. not print anything because the log function would simply log to global).
Then at some point log() didn't depend on console being it's this. I've never seen a single sentence of explanation why this was changed, I've never used this kind of aliasing in browser so I'm not even sure it's a Node.js console implementation bug or a V8 bug, nor how Firefox behaved before (doesn't need bind() now).
So he was right.
Edit: Ah, yes, just needed to scroll down and find another post re the same thing and presto:
Aw thanks for the defense! Ya I looked through the chromium and firefox bugs and it looks like these have been very quietly resolved within the past year and a half.
But as I said in my edit, this is just one more thing on the "in my day" category now. For those of us using JavaScript since before jQuery, that category is quite huge and ever-growing. It's actually kind of delightful to be wrong in this way.
I'm no Samaritan tho, just extremely irritated by immature Reddit behavior of downvoting people out of own ignorance. Downvoting non-abuse is bad enough, but this really makes my blood boil sometimes.
20
u/[deleted] Dec 17 '18 edited Dec 17 '18
Stop downvoting him, assholes.
This didn't work without binding up until, if I'm not mistaken, Node.js 8.x. I don't remember it causing any errors, if I remember correctly it used to silently fail (i.e. not print anything because the log function would simply log to
global).Then at some point
log()didn't depend onconsolebeing it'sthis. I've never seen a single sentence of explanation why this was changed, I've never used this kind of aliasing in browser so I'm not even sure it's a Node.jsconsoleimplementation bug or a V8 bug, nor how Firefox behaved before (doesn't needbind()now).So he was right.
Edit: Ah, yes, just needed to scroll down and find another post re the same thing and presto:
https://chromium.googlesource.com/chromium/src.git/+/807ec9550e8a31517966636e6a5b506474ab4ea9