Possible bug on `ViewDesc.posBeforeChild`

Hey @marijn, is this change on posBeforeChild intentional?

// Before TypeScript port (1.23.13)
  posBeforeChild(child) {
    for (let i = 0, pos = this.posAtStart; i < this.children.length; i++) {
// After TypeScript port (1.24.0)
  posBeforeChild(child: ViewDesc): number {
    for (let i = 0, pos = this.posAtStart;; i++) {

Now, the for loop isn’t stoping when the counter is bigger than the amount of children. As result, cur is getting null and the operation cur.size is throwing an error.

How is this being called with a node that’s not a child of the target node?

We have some CustomNodeViews using React internally. So, in some moment a getPos() is being called during the re-render.

I still need to do a proper investigation how we can create a simple reproduce steps for it. For now, I am trying to understand if that change in the for-loop was intentional.

The return type is number, not number | undefined, so yeah, that function isn’t supposed to be called on things that aren’t children.