Skip to content

feat(pluginutils): add staticBlock(es2022) support#2000

Open
linsk1998 wants to merge 2 commits into
rollup:masterfrom
linsk1998:master
Open

feat(pluginutils): add staticBlock(es2022) support#2000
linsk1998 wants to merge 2 commits into
rollup:masterfrom
linsk1998:master

Conversation

@linsk1998
Copy link
Copy Markdown
Contributor

Rollup Plugin Name: pluginutils

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

  1. Static blocks are a new syntax feature introduced in ES2022;
  2. Static blocks run in a function scope;
  3. The pluginutils package currently lacks support for this syntax;
  4. Missing support causes parsing failures for code containing class static blocks, e.g.:
console.log(foo); // The inject plugin incorrectly identifies `foo` as a global variable
class Bar {
    static {
        var foo = 1; // Declared in static block (function-scoped)
    }
}

@linsk1998 linsk1998 requested a review from shellscape as a code owner May 18, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant