When does this condition ever evaluate true?

Is there a global rebased that I’m not seeing?

I don’t understand the question. The first of those lines executes always, and the second only for transactions that have history metadata (undo or redo transactions). Why would there be a global rebased? That’s being declared locally there.

Yea, I realized “evaluate” was the wrong choice of words so I changed the title but I was a bit slow on the draw. Sorry about that.

I haven’t encountered the comma operator used in such a way in the wild before. Isn’t historyTr being assigned rebased?

If so, I don’t see where rebased is defined prior to the statement.

It could be that I’m being dense and don’t understand the mechanics of the comma operator. So far as I understand it, the first expression, tr.getMeta(historyKey), evaluates but the second is the actual result in the assignment (rebased in this case).

Ahh, yea. I was being dense. The assignment semantics don’t apply when it’s a let, const, var statement.

I apologize about this silly post.


let x = 1;
x = (1, 2); 
console.log(x); // 2
x = 1, 2;
console.log(x); // 1