Skip to content

bug(data.js): prototype is really really bad here #5336

@ice6

Description

@ice6

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

if (typeof (Array.prototype.remove) !== 'function') {
    Array.prototype.remove = function(item) {
        const index = this.indexOf(item);
        if (index > -1) {
            this.splice(index, 1);
        }
        return this;
    }
}

this can breaks other libraries like luckyexcel. and all other library using for(var key in arr) alike code may be affected.

Expected Behavior

delete this prototype if possible.

Interactive render mode

Interactive Server (Interactive server-side rendering (interactive SSR) using Blazor Server)

Steps To Reproduce

no need.

Exceptions (if any)

No response

.NET Version

NET9.0

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions