mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(transformer/typescript): missing initializer for class constructor arguments with private and protected modifier (#3996)
close: #3992
This commit is contained in:
parent
23038ad8f8
commit
a50ce3d299
5 changed files with 16 additions and 2 deletions
2
.github/workflows/link-check.yml
vendored
2
.github/workflows/link-check.yml
vendored
|
|
@ -8,11 +8,13 @@ on:
|
|||
paths:
|
||||
- '**/*.md'
|
||||
- '**/*.html'
|
||||
- '!**/fixtures/**'
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
paths:
|
||||
- '**/*.md'
|
||||
- '**/*.html'
|
||||
- '!**/fixtures/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ impl<'a> TypeScriptAnnotations<'a> {
|
|||
// for each of them in the constructor body.
|
||||
if def.kind == MethodDefinitionKind::Constructor {
|
||||
for param in def.value.params.items.as_mut_slice() {
|
||||
if param.is_public() {
|
||||
if param.accessibility.is_some() {
|
||||
if let Some(id) = param.pattern.get_binding_identifier() {
|
||||
self.assignments.push(Assignment {
|
||||
span: id.span,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
commit: 12619ffe
|
||||
|
||||
Passed: 4/4
|
||||
Passed: 5/5
|
||||
|
||||
# All Passed:
|
||||
* babel-plugin-transform-typescript
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
class Foo {
|
||||
constructor(public foo, private bar, protected zoo, too) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
class Foo {
|
||||
constructor(foo, bar, zoo, too) {
|
||||
this.foo = foo;
|
||||
this.bar = bar;
|
||||
this.zoo = zoo;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue