修改扩展语法检查方式
This commit is contained in:
parent
d9022bb482
commit
f72fe09b22
|
@ -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);
|
object = await (gnc.is.generatorFunc(object) ? gnc.of(object) : object)(lib, game, ui, get, ai, _status);
|
||||||
noEval = true;
|
noEval = true;
|
||||||
}
|
}
|
||||||
|
if(object.closeSyntaxCheck){
|
||||||
|
noEval = true;
|
||||||
|
}
|
||||||
const name = object.name, extensionName = `extension_${name}`, extensionMenu = lib.extensionMenu[extensionName] = {
|
const name = object.name, extensionName = `extension_${name}`, extensionMenu = lib.extensionMenu[extensionName] = {
|
||||||
enable: {
|
enable: {
|
||||||
name: '开启',
|
name: '开启',
|
||||||
|
|
|
@ -708,7 +708,11 @@ export class LibInit extends Uninstantable {
|
||||||
}
|
}
|
||||||
else if (typeof func == 'object') {
|
else if (typeof func == 'object') {
|
||||||
for (var i in func) {
|
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]);
|
func[i] = lib.init.eval(func[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue