fix: check object type for in operator

This commit is contained in:
cha0s 2024-06-25 10:51:56 -05:00
parent 13b2a63f07
commit 2200332c40

View File

@ -1,7 +1,7 @@
export default function(fn, holder, args) { export default function(fn, holder, args) {
if (holder) { if (holder) {
const {name} = fn; const {name} = fn;
if (name in holder && holder[name] === fn) { if ('object' === typeof holder && name in holder && holder[name] === fn) {
switch (args.length) { switch (args.length) {
case 0 : return holder[name](); case 0 : return holder[name]();
case 1 : return holder[name](args[0]); case 1 : return holder[name](args[0]);