mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
106 lines
5.7 KiB
Plaintext
106 lines
5.7 KiB
Plaintext
//// [tests/cases/compiler/circularControlFlowNarrowingWithCurrentElement01.ts] ////
|
|
|
|
=== circularControlFlowNarrowingWithCurrentElement01.ts ===
|
|
class A {
|
|
>A : Symbol(A, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 0))
|
|
|
|
next: A | null = null;
|
|
>next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>A : Symbol(A, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 0))
|
|
|
|
constructor(readonly children: (A | null)[]) {}
|
|
>children : Symbol(A.children, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 3, 14))
|
|
>A : Symbol(A, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 0))
|
|
}
|
|
|
|
function getNodes(): A[] {
|
|
>getNodes : Symbol(getNodes, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 4, 1))
|
|
>A : Symbol(A, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 0))
|
|
|
|
const out: A[] = [];
|
|
>out : Symbol(out, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 7, 7))
|
|
>A : Symbol(A, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 0))
|
|
|
|
let current: A | null = new A([]);
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>A : Symbol(A, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 0))
|
|
>A : Symbol(A, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 0))
|
|
|
|
while (current !== null) {
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
|
|
let firstChild = null;
|
|
>firstChild : Symbol(firstChild, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 12, 7))
|
|
|
|
if (out.length) {
|
|
>out.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
|
|
>out : Symbol(out, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 7, 7))
|
|
>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
|
|
|
|
current = current.next;
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>current.next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
|
|
continue;
|
|
}
|
|
|
|
for (let i = 0; i < current.children.length; i++) {
|
|
>i : Symbol(i, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 19, 12))
|
|
>i : Symbol(i, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 19, 12))
|
|
>current.children.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
|
|
>current.children : Symbol(A.children, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 3, 14))
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>children : Symbol(A.children, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 3, 14))
|
|
>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --))
|
|
>i : Symbol(i, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 19, 12))
|
|
|
|
const child = current.children[i];
|
|
>child : Symbol(child, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 20, 11))
|
|
>current.children : Symbol(A.children, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 3, 14))
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>children : Symbol(A.children, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 3, 14))
|
|
>i : Symbol(i, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 19, 12))
|
|
|
|
if (child) {
|
|
>child : Symbol(child, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 20, 11))
|
|
|
|
if (!firstChild) {
|
|
>firstChild : Symbol(firstChild, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 12, 7))
|
|
|
|
firstChild = child;
|
|
>firstChild : Symbol(firstChild, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 12, 7))
|
|
>child : Symbol(child, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 20, 11))
|
|
|
|
firstChild.next = current.next;
|
|
>firstChild.next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>firstChild : Symbol(firstChild, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 12, 7))
|
|
>next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>current.next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
}
|
|
|
|
child.next = current.next;
|
|
>child.next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>child : Symbol(child, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 20, 11))
|
|
>next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>current.next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
}
|
|
}
|
|
|
|
current = firstChild || current.next;
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>firstChild : Symbol(firstChild, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 12, 7))
|
|
>current.next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
>current : Symbol(current, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 9, 5))
|
|
>next : Symbol(A.next, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 0, 9))
|
|
}
|
|
|
|
return out;
|
|
>out : Symbol(out, Decl(circularControlFlowNarrowingWithCurrentElement01.ts, 7, 7))
|
|
}
|