News for hackers. Stuff that matters.
Re:Why is the Zoom app listening on my microphone when not i... by vinayakpandey on Tuesday February 08, 2022 @10:18PM (#30268335)
A function returns undefined if any value was not returned.
Re:Why is the Zoom app listening on my microphone when not i... by chrismorgan on Tuesday February 08, 2022 @10:30PM (#30268412)
True generally, but irrelevant here: the function in question is RegExp.prototype.match. By definition, it never returns undefined, but only an array or null. The only way `match == undefined` could be true would be if smething had overridden RegExp.prototype.match, which would be… surprising and worthy of explicit note.

Also match[1] will never be undefined: it’ll either throw an exception, or be a string. No, this is just a bug, a poorly written guard that fails to guard what it was supposed to, and I suppose an exception is just silently swallowed and treated equivalently to the intended early return. But the clause should be changed to just `if (!match) return;` or similar.

Re:Why is the Zoom app listening on my microphone when not i... by olliej on Wednesday February 09, 2022 @01:12AM (#30269515)
Quick heads up you may want to update that to be === rather than ==, because of course JS is wonderful and null does == undefined (not a nerd snipe, I was just confused by your comment and went and looked at the code, and realized it was likely a typo :) )
Re:Why is the Zoom app listening on my microphone when not i... by chrismorgan on Wednesday February 09, 2022 @07:31AM (#30271869)
Yeah, unfortunate typo, thanks for the correction. I spend most of my time writing Rust, and when I’m writing JavaScript I type !== and === naturally, but I think writing this comment I just didn’t quite switch into JavaScript mode.