- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
what language is that code?
function() => { }is not legal js or php as far as i know, either you use() => { }orfunction() { }without the arrow. might just be a typo but its wierdAdmin
It's Javascript, and as far as I'm concerned, JS in the backend is the real WTF. I would say: how could this not have happened at some point?
Admin
Pretty sure there's just a missing )
Edit Admin
it's not valid JavaScript. Traditional function syntax is
function(params) { body }, ES6 arrow function syntax is(params) => { body }. You can't have both thefunctionkeyword and=>.But other than that it looks like pretty normal Node.js using the Express framework.
Edit Admin
| why didn't this blow up the logs earlier?
Would any regulars around here really be surprised at how often logging is misconfigured, disabled, or outright ignored? This probably blew up the logs because someone took a moment to fix the logging mechanisms.
Edit Admin
That wouldn't surprise me at all if that was the reason. Though it could also be that the code wasn't actually being called previously; perhaps based a condition that wasn't being met.
Admin
The real wtf is that JS can read/parse es5+es6 at the same time, so that looks valid to me.
Their database probably was down or was getting hit with junk to get the next call to trigger, because why else would the next have not fired before