From 284bc7f25a82e242d90013fdad4f4cc41a37566c Mon Sep 17 00:00:00 2001 From: kuangthree Date: Sat, 3 Feb 2024 17:58:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/library/init/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/noname/library/init/index.js b/noname/library/init/index.js index 735b2bb75..21e3b349c 100644 --- a/noname/library/init/index.js +++ b/noname/library/init/index.js @@ -708,12 +708,14 @@ export class LibInit extends Uninstantable { } else if (typeof func == 'object') { for (var i in func) { - if(typeof func[i] == 'function'){ - let checkObject = {}; - checkObject[i] = func[i]; - return eval(`(function(){return ${get.stringify(checkObject)};})()`)[i]; - }else{ - func[i] = lib.init.eval(func[i]); + if (Object.prototype.hasOwnProperty.call(func, i)) { + if(typeof func[i] == 'function'){ + let checkObject = {}; + checkObject[i] = func[i]; + return eval(`(function(){return ${get.stringify(checkObject)};})()`)[i]; + }else{ + func[i] = lib.init.eval(func[i]); + } } } }