Skip to content

(es/minifier): unused arguments of functions not dropped in array or object #9945

@Le0Developer

Description

@Le0Developer

Describe the feature

If a function is declared inside an array or object, unused arguments don't get removed.

const arr = [
    function test(unused) {}
]

const obj = {
    a: function test(unused) {}
}

function test(unused) {}

console.log(arr, obj, test)

Output:

console.log([
    function(unused) {}
], {
    a: function(unused) {}
}, function() {});

Babel plugin or link to the feature description

No response

Additional context

Playground link

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions