diff --git a/noname/game/index.js b/noname/game/index.js index 00c61270c..7fefb3262 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -1782,6 +1782,9 @@ export class Game extends Uninstantable { object = await (gnc.is.generatorFunc(object) ? gnc.of(object) : object)(lib, game, ui, get, ai, _status); noEval = true; } + if(object.closeSyntaxCheck){ + noEval = true; + } const name = object.name, extensionName = `extension_${name}`, extensionMenu = lib.extensionMenu[extensionName] = { enable: { name: '开启', diff --git a/noname/library/init/index.js b/noname/library/init/index.js index 41f3f2612..735b2bb75 100644 --- a/noname/library/init/index.js +++ b/noname/library/init/index.js @@ -708,7 +708,11 @@ export class LibInit extends Uninstantable { } else if (typeof func == 'object') { for (var i in func) { - 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]); } }