Handle undefined arguments without crashing in skooma
This commit is contained in:
parent
ca600401ed
commit
f6556d369a
1 changed files with 2 additions and 0 deletions
|
@ -40,6 +40,8 @@ const parseArgs = (element, before, ...args) => {
|
|||
for (let arg of args)
|
||||
if (typeof arg == "string" || typeof arg == "number")
|
||||
element.insertBefore(document.createTextNode(arg), before)
|
||||
else if (arg === undefined)
|
||||
console.warn(`Argument is ${typeof arg}`, element)
|
||||
else if (typeof arg == "function")
|
||||
arg(element)
|
||||
else if ("nodeName" in arg)
|
||||
|
|
Loading…
Reference in a new issue