Skip to content

formatter: Missing parens for PrivateInExpression #14437

@leaysgur

Description

@leaysgur

Input

class F{
  #target = null
  next (target) {
    if (!(#target in this)) return
    if (!(target in this)) return
  }
}

Expect

class F {
  #target = null;
  next(target) {
    if (!(#target in this)) return;
    if (!(target in this)) return;
  }
}

Actual

class F {
  #target = null;
  next(target) {
    if (!#target in this) return;
    if (!(target in this)) return;
  }
}

Parens are needed for #target in this.

Original: https://github.com/nodejs/undici/blob/6d912de9548617b478d7700514af664fb0b37324/lib/web/fetch/util.js#L763

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions