Skip to content

minifier: drop unused "in" operator #25858

Description

@4eb0da

Input:

"WeakMap" in (typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : global);

Output:

`WeakMap`in(typeof window<`u`?window:typeof globalThis<`u`?globalThis:global);

Playground

Expected behavior:
The "in" operator is completely removed
This code can potentially have side effects when using a proxy, but this is a rare case
compress.treeshake.propertyReadSideEffects and unknownGlobalSideEffects do not affect this code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions