Merge pull request #363 from nofficalfs/PR-Bug-Parsex
[Bug] 兼容修复 | `Event#setContent`及`lib.init.parsex`接纳更多参数
This commit is contained in:
commit
7fb14225b0
18
game/game.js
18
game/game.js
|
@ -10302,8 +10302,14 @@
|
|||
}
|
||||
}
|
||||
else{
|
||||
// TODO: Parse Common Object
|
||||
throw new Error("NYI: Parse Common Object");
|
||||
if(Symbol.iterator in item) return lib.init.parsex(Array.from(item));
|
||||
if("toString" in item) return lib.init.parsex(item.toString());
|
||||
if("render" in item) {
|
||||
// TODO: Object Render Parse
|
||||
throw new Error("NYI: Object Render Parse");
|
||||
}
|
||||
// TODO: Object Other Parse
|
||||
throw new Error("NYI: Object Other Parse");
|
||||
}
|
||||
case "function":
|
||||
if (gnc.is.generatorFunc(item)) {
|
||||
|
@ -10329,7 +10335,8 @@
|
|||
else lastEvent=res.value;
|
||||
}
|
||||
}
|
||||
else return Legacy(item);
|
||||
default:
|
||||
return Legacy(item);
|
||||
}
|
||||
},
|
||||
eval:function(func){
|
||||
|
@ -28744,10 +28751,15 @@
|
|||
this.content=lib.init.parsex(item);
|
||||
break;
|
||||
default:
|
||||
try{
|
||||
if(!lib.element.content[item]._parsed){
|
||||
lib.element.content[item]=lib.init.parsex(lib.element.content[item]);
|
||||
lib.element.content[item]._parsed=true;
|
||||
}
|
||||
}
|
||||
catch{
|
||||
throw new Error(`Content ${item} may not exist.\nlib.element.content[${item}] = ${lib.element.content[item]}`);
|
||||
}
|
||||
this.content=lib.element.content[item];
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue