mirror of
https://github.com/horsicq/Detect-It-Easy.git
synced 2026-06-24 01:54:08 +00:00
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:
parent
cee995906c
commit
bdbbb92cb7
1 changed files with 2 additions and 1 deletions
3
db/read
3
db/read
|
|
@ -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>",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue