From a2cbab4a25b4e8f8f53017ccfa9c410a4d7e9275 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 27 Sep 2023 14:10:23 +0800 Subject: [PATCH 1/2] remove original defining property. --- game/game.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/game/game.js b/game/game.js index f6a6a37b9..8ed83cbe4 100644 --- a/game/game.js +++ b/game/game.js @@ -8953,26 +8953,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; From e95679595397b7dea3c5208515632bdafa44df21 Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 27 Sep 2023 14:12:51 +0800 Subject: [PATCH 2/2] making creation in `lib.creation`. --- game/game.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index 8ed83cbe4..416b41d41 100644 --- a/game/game.js +++ b/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}]`,