Skip to content

Clarify the behavior of #__NO_SIDE_EFFECTS__ for new expressions and tagged templates #8

@sapphi-red

Description

@sapphi-red

The spec does not clarify whether #__NO_SIDE_EFFECTS__ applies to new expressions and tagged templates.

/* #__NO_SIDE_EFFECTS__ */ function foo() { console.log('foo') }

new foo()
foo``
Tool new expr tagged templ playground
Rollup link
esbuild link
SWC link
Oxc link

✅: removes the expression
❌: does not remove the expression

Currently, the behaviors are not aligned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions