fix custom Array.prototype interfering with for-in loops

This commit is contained in:
julien delnatte 2021-05-06 17:52:24 +02:00
commit fff0f8b514

View file

@ -3,7 +3,7 @@
"use strict";
(function() {
var AP = Array.prototype;
var AP = {};
/** ******************************************************************
* Array prototype helpers
@ -166,6 +166,13 @@
return this.slice().sort().filter((x, i, a) => !i || x != a[i-1]);
};
for(let i in AP){
Object.defineProperty(Array.prototype, i, {
value: AP[i],
enumerable: false
});
}
/** ******************************************************************
* String prototype helpers
******************************************************************* */