DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.33k stars 28 forks source link

Missing parens in `.-1` access in certain contexts #1235

Closed bbrk24 closed 1 day ago

bbrk24 commented 1 month ago
child.appendChild card.html if card? := engine.board.foundation.asc[i].-1

Actual output:

let ref;
let ref1;
if ((ref1 = ref = engine.board.foundation.asc[i][ref.length - 1]) != null) {
  const card = ref1;
  child.appendChild(card.html);
}

Expected output:

let ref;
let ref1;
if ((ref1 = (ref = engine.board.foundation.asc[i])[ref.length - 1]) != null) {
  const card = ref1;
  child.appendChild(card.html);
}
STRd6 commented 2 weeks ago

Fixed in https://github.com/DanielXMoore/Civet/pull/1263