vscode-javascript-booster icon indicating copy to clipboard operation
vscode-javascript-booster copied to clipboard

Small issue with ternary (?:) replacement

Open ThomasMldr opened this issue 3 years ago • 0 comments

This

if (condition) {
  this.text = "one";
} else {
  this.text = "two";
}

becomes: condition ? this.text = "one" : this.text = "two"; instead of the desired: this.text = condition ? "one" : "two";

This only happens when the assignment happens to a variable beginning with this.. if it was just text instead of this.text the replace happens correctly (text = condition ? "one" : "two";)

ThomasMldr avatar Aug 05 '22 11:08 ThomasMldr