Sitelet https://github.com/evanw/esbuild/pull/4513
Skip to content

Fix computed constructor getters during class lowering - #4513

Open
Boulea7 wants to merge 1 commit into
evanw:mainfrom
Boulea7:fix/issue-4495-computed-constructor-getter
Open

Boulea7 wants to merge 1 commit into
evanw:mainfrom
Boulea7:fix/issue-4495-computed-constructor-getter

Conversation

@Boulea7

@Boulea7 Boulea7 commented Aug 10, 2026

Copy link
Copy Markdown

Fixes #4495

A computed getter named "constructor" was being treated as the actual class constructor during class lowering. That put the generated __super helper in the getter instead of the constructor and produced invalid output for older targets such as Node 10.

This change only identifies non-static, non-computed methods as constructors and adds regression coverage for the computed getter case.

Tests:

  • env -u GOROOT go test -race ./cmd/... ./internal/... ./pkg/...
  • env -u GOROOT go vet ./cmd/... ./internal/... ./pkg/...

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.

SyntaxError: 'super' keyword unexpected here

1 participant