Skip to content

transformer: missing initializer for TypeScript class constructor arguments with private modifier #3992

@yyx990803

Description

@yyx990803

Discovered this when bundling Vue via Rolldown:

In

class Foo {
  constructor(public foo, private bar) {}
}

Out

class Foo {
  constructor(foo, bar) {
    this.foo = foo
    // !!! `this.bar = bar` is missing
  }
}

Expected

class Foo {
  constructor(foo, bar) {
    this.foo = foo
    this.bar = bar
  }
}

Metadata

Metadata

Assignees

Labels

A-transformerArea - Transformer / TranspilerC-bugCategory - Bug

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions