1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
=== tests/cases/conformance/types/typeRelationships/comparable/equalityWithtNullishCoalescingAssignment.ts ===
function f1(a?: boolean): void {
>f1 : (a?: boolean) => void
>a : boolean
a ??= true;
>a ??= true : boolean
>a : boolean
>true : true
if (a === false) {
>a === false : boolean
>a : boolean
>false : false
console.log(a);
>console.log(a) : void
>console.log : (...data: any[]) => void
>console : Console
>log : (...data: any[]) => void
>a : false
}
}
f1(false);
>f1(false) : void
>f1 : (a?: boolean) => void
>false : false
function f2() {
>f2 : () => void
let x: 0 | 1 | 2 | 3 = 0 as any;
>x : 0 | 1 | 2 | 3
>0 as any : any
>0 : 0
x ??= 1;
>x ??= 1 : 0 | 1 | 2 | 3
>x : 0 | 1 | 2 | 3
>1 : 1
if (x === 0) {
>x === 0 : boolean
>x : 0 | 1 | 2 | 3
>0 : 0
console.log(x);
>console.log(x) : void
>console.log : (...data: any[]) => void
>console : Console
>log : (...data: any[]) => void
>x : 0
}
}
|