Closed infiniteperplexity closed 3 years ago
Good idea!
@ondras will you accept a PR, I can add this. Got an issue yesterday when the other library failed to run because it uses for..in on Array. Need to use a hack to temporarily remove the polluted properties while executing function from the other library.
The library was filget.js when loading a font. I've already added PR that that library to add hasOwnProperty.
@ondras will you accept a PR, I can add this.
Yes, please. I am completely out of time these days :-(
I've already added PR that that library to add hasOwnProperty.
A better solution IMHO would be to stop iterating arrays with for..in and use other looping approaches.
A better solution IMHO would be to stop iterating arrays with for..in and use other looping approaches.
Yes, but this is not my code that does that.
I think that this is no longer valid. The library doesn't pollute Array prototype anymore. In my case, I was using an older version of the library.
I think this can be closed.
I think that it got removed when the project was migrated to TS. Because the last commit that had Array.prototype is 2392039cecc8de3a97c09ec94d2bf6286e130fc0 cleanup when _old file was deleted.
i.e.
Object.defineProperty(Array.prototype, 'random', { enumerable: false });
Object.defineProperty(Array.prototype, 'randomize', { enumerable: false });