Merge pull request #411 from nofficalfs/PR-Enhancement-CreationInclude
[Enhancement] 更改`lib.creation`的原理
This commit is contained in:
commit
62a4d7d553
35
game/game.js
35
game/game.js
|
@ -7773,7 +7773,20 @@
|
|||
return true;
|
||||
}
|
||||
},
|
||||
creation:{},
|
||||
creation:{
|
||||
get array(){
|
||||
return [];
|
||||
},
|
||||
get object(){
|
||||
return {};
|
||||
},
|
||||
get nullObject(){
|
||||
return Object.create(null);
|
||||
},
|
||||
get string(){
|
||||
return "";
|
||||
}
|
||||
},
|
||||
linq:{
|
||||
cselector:{
|
||||
hasAttr:name=>`[${name}]`,
|
||||
|
@ -8953,26 +8966,6 @@
|
|||
|
||||
window.game=game;
|
||||
game.dynamicStyle.init();
|
||||
Object.defineProperty(lib.creation,"array",{
|
||||
enumerable:true,
|
||||
get:()=>[],
|
||||
set:()=>null
|
||||
});
|
||||
Object.defineProperty(lib.creation,"object",{
|
||||
enumerable:true,
|
||||
get:()=>({}),
|
||||
set:()=>null
|
||||
});
|
||||
Object.defineProperty(lib.creation,"nullObject",{
|
||||
enumerable:true,
|
||||
get:()=>Object.create(null),
|
||||
set:()=>null
|
||||
});
|
||||
Object.defineProperty(lib.creation,"string",{
|
||||
enumerable:true,
|
||||
get:()=>"",
|
||||
set:()=>null
|
||||
});
|
||||
// node:path library alternative
|
||||
if (typeof module!="object"||typeof module.exports!="object") lib.init.js(`${lib.assetURL}game`,"path.min",()=>{
|
||||
lib.path=window._noname_path;
|
||||
|
|
Loading…
Reference in New Issue