Fix default parameter handling in _logIt function

Replaces the default parameter assignment for 'msg' with an explicit check and assignment inside the function. This ensures compatibility with environments that do not support default parameters.
This commit is contained in:
DosX 2025-09-14 21:37:20 +03:00
commit bdbbb92cb7

View file

@ -816,7 +816,8 @@ function _currentLine() {
}
//Simply logs the calling function and the current line. All hail the printf debugging!
function _logIt(msg = "") {
function _logIt(msg) {
if (!msg) msg = "";
const callerLine = new Error().stack.split("\n")[1] || "",
fnmatch = callerLine.match(/^(\w+)@/), // extract function name
fnName = fnmatch ? fnmatch[1] : "<anon>",