Concerning this line: https://github.com/arkadiyt/zoom-redirector/blob/master/back... Why is it sometimes returning undefined? (or is that known)?
Cheers!
Concerning this line: https://github.com/arkadiyt/zoom-redirector/blob/master/back... Why is it sometimes returning undefined? (or is that known)?
Cheers!
Sure thing. All browser extension source code is available to you anyhow, even if the author doesn't publish it.
> Why is it sometimes returning undefined?
Looks like a simple bug as some folks below have pointed out. It doesn't impact the functionality of the extension in any way here.
> const match = /^\/[js]\/(\d+)\/?$/.exec("something")
> undefined
[1] https://tc39.es/ecma262/multipage/ecmascript-language-statem... [2] https://tc39.es/ecma262/multipage/ecmascript-language-statem...
What fun! :-)
Edit: apparently as also mentioned https://news.ycombinator.com/item?id=30268412
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.