fix custom Array.prototype interfering with for-in loops
This commit is contained in:
parent
246afa752d
commit
fff0f8b514
1 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
******************************************************************* */
|
||||
|
|
|
|||
Loading…
Reference in a new issue