diff --git a/game/game.js b/game/game.js index 4c3ce75fe..ebb180795 100644 --- a/game/game.js +++ b/game/game.js @@ -8173,6 +8173,59 @@ return this.childNodes[row].childNodes[col]; } }; + /*处理lib.nature的兼容性问题*/ + const mapHasFunc=function(item){ + return this.has(item) + }; + Object.defineProperty(Map.prototype, "contains",{ + configurable:true, + enumerable:false, + writable:true, + value:mapHasFunc + }); + Object.defineProperty(Map.prototype, "includes",{ + configurable:true, + enumerable:false, + writable:true, + value:mapHasFunc + }); + const mapAddFunc=function(item){ + this.set(item,0); + return this; + } + Object.defineProperty(Map.prototype, "add", { + configurable:true, + enumerable:false, + writable:true, + value:mapAddFunc + }); + Object.defineProperty(Map.prototype, "push", { + configurable:true, + enumerable:false, + writable:true, + value:mapAddFunc + }); + Object.defineProperty(Map.prototype, "addArray", { + configurable:true, + enumerable:false, + writable:true, + value:function(arr){ + for(var i=0;i