33 lines
1.1 KiB
Text
33 lines
1.1 KiB
Text
=== tests/cases/compiler/conditionalExpressions2.ts ===
|
|
var a = false ? 1 : null;
|
|
>a : Symbol(a, Decl(conditionalExpressions2.ts, 0, 3))
|
|
|
|
var b = false ? undefined : 0;
|
|
>b : Symbol(b, Decl(conditionalExpressions2.ts, 1, 3))
|
|
>undefined : Symbol(undefined)
|
|
|
|
var c = false ? 1 : 0;
|
|
>c : Symbol(c, Decl(conditionalExpressions2.ts, 2, 3))
|
|
|
|
var d = false ? false : true;
|
|
>d : Symbol(d, Decl(conditionalExpressions2.ts, 3, 3))
|
|
|
|
var e = false ? "foo" : "bar";
|
|
>e : Symbol(e, Decl(conditionalExpressions2.ts, 4, 3))
|
|
|
|
var f = false ? null : undefined;
|
|
>f : Symbol(f, Decl(conditionalExpressions2.ts, 5, 3))
|
|
>undefined : Symbol(undefined)
|
|
|
|
var g = true ? {g:5} : null;
|
|
>g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 3))
|
|
>g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 16))
|
|
|
|
var h = [{h:5}, null];
|
|
>h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 3))
|
|
>h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 10))
|
|
|
|
function i() { if (true) { return { x: 5 }; } else { return null; } }
|
|
>i : Symbol(i, Decl(conditionalExpressions2.ts, 7, 22))
|
|
>x : Symbol(x, Decl(conditionalExpressions2.ts, 8, 35))
|
|
|