Skip to content

[@rollup/plugin-commonjs] Incorrect compilation of this in field declaration inside a class. #1479

@quangloc99

Description

@quangloc99

Expected Behavior

this inside class A should be preserved after commonjs transformation.

When running npm run exec:dev, the output is 1.

Actual Behavior

this inside class A is transformed into commonjsGlobal.

When running npm run exec:build, an error is thrown.

Additional Information

The check here is heuristic. It does not check for the case of class.

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