mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Accepting new baselines
This commit is contained in:
parent
33e359ff13
commit
bab8ef4b10
48
tests/baselines/reference/controlFlowCommaOperator.js
Normal file
48
tests/baselines/reference/controlFlowCommaOperator.js
Normal file
@ -0,0 +1,48 @@
|
||||
//// [controlFlowCommaOperator.ts]
|
||||
function f(x: string | number | boolean) {
|
||||
let y: string | number | boolean = false;
|
||||
let z: string | number | boolean = false;
|
||||
if (y = "", typeof x === "string") {
|
||||
x; // string
|
||||
y; // string
|
||||
z; // boolean
|
||||
}
|
||||
else if (z = 1, typeof x === "number") {
|
||||
x; // number
|
||||
y; // string
|
||||
z; // number
|
||||
}
|
||||
else {
|
||||
x; // boolean
|
||||
y; // string
|
||||
z; // number
|
||||
}
|
||||
x; // string | number | boolean
|
||||
y; // string
|
||||
z; // number | boolean
|
||||
}
|
||||
|
||||
|
||||
//// [controlFlowCommaOperator.js]
|
||||
function f(x) {
|
||||
var y = false;
|
||||
var z = false;
|
||||
if (y = "", typeof x === "string") {
|
||||
x; // string
|
||||
y; // string
|
||||
z; // boolean
|
||||
}
|
||||
else if (z = 1, typeof x === "number") {
|
||||
x; // number
|
||||
y; // string
|
||||
z; // number
|
||||
}
|
||||
else {
|
||||
x; // boolean
|
||||
y; // string
|
||||
z; // number
|
||||
}
|
||||
x; // string | number | boolean
|
||||
y; // string
|
||||
z; // number | boolean
|
||||
}
|
||||
57
tests/baselines/reference/controlFlowCommaOperator.symbols
Normal file
57
tests/baselines/reference/controlFlowCommaOperator.symbols
Normal file
@ -0,0 +1,57 @@
|
||||
=== tests/cases/conformance/controlFlow/controlFlowCommaOperator.ts ===
|
||||
function f(x: string | number | boolean) {
|
||||
>f : Symbol(f, Decl(controlFlowCommaOperator.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(controlFlowCommaOperator.ts, 0, 11))
|
||||
|
||||
let y: string | number | boolean = false;
|
||||
>y : Symbol(y, Decl(controlFlowCommaOperator.ts, 1, 7))
|
||||
|
||||
let z: string | number | boolean = false;
|
||||
>z : Symbol(z, Decl(controlFlowCommaOperator.ts, 2, 7))
|
||||
|
||||
if (y = "", typeof x === "string") {
|
||||
>y : Symbol(y, Decl(controlFlowCommaOperator.ts, 1, 7))
|
||||
>x : Symbol(x, Decl(controlFlowCommaOperator.ts, 0, 11))
|
||||
|
||||
x; // string
|
||||
>x : Symbol(x, Decl(controlFlowCommaOperator.ts, 0, 11))
|
||||
|
||||
y; // string
|
||||
>y : Symbol(y, Decl(controlFlowCommaOperator.ts, 1, 7))
|
||||
|
||||
z; // boolean
|
||||
>z : Symbol(z, Decl(controlFlowCommaOperator.ts, 2, 7))
|
||||
}
|
||||
else if (z = 1, typeof x === "number") {
|
||||
>z : Symbol(z, Decl(controlFlowCommaOperator.ts, 2, 7))
|
||||
>x : Symbol(x, Decl(controlFlowCommaOperator.ts, 0, 11))
|
||||
|
||||
x; // number
|
||||
>x : Symbol(x, Decl(controlFlowCommaOperator.ts, 0, 11))
|
||||
|
||||
y; // string
|
||||
>y : Symbol(y, Decl(controlFlowCommaOperator.ts, 1, 7))
|
||||
|
||||
z; // number
|
||||
>z : Symbol(z, Decl(controlFlowCommaOperator.ts, 2, 7))
|
||||
}
|
||||
else {
|
||||
x; // boolean
|
||||
>x : Symbol(x, Decl(controlFlowCommaOperator.ts, 0, 11))
|
||||
|
||||
y; // string
|
||||
>y : Symbol(y, Decl(controlFlowCommaOperator.ts, 1, 7))
|
||||
|
||||
z; // number
|
||||
>z : Symbol(z, Decl(controlFlowCommaOperator.ts, 2, 7))
|
||||
}
|
||||
x; // string | number | boolean
|
||||
>x : Symbol(x, Decl(controlFlowCommaOperator.ts, 0, 11))
|
||||
|
||||
y; // string
|
||||
>y : Symbol(y, Decl(controlFlowCommaOperator.ts, 1, 7))
|
||||
|
||||
z; // number | boolean
|
||||
>z : Symbol(z, Decl(controlFlowCommaOperator.ts, 2, 7))
|
||||
}
|
||||
|
||||
71
tests/baselines/reference/controlFlowCommaOperator.types
Normal file
71
tests/baselines/reference/controlFlowCommaOperator.types
Normal file
@ -0,0 +1,71 @@
|
||||
=== tests/cases/conformance/controlFlow/controlFlowCommaOperator.ts ===
|
||||
function f(x: string | number | boolean) {
|
||||
>f : (x: string | number | boolean) => void
|
||||
>x : string | number | boolean
|
||||
|
||||
let y: string | number | boolean = false;
|
||||
>y : string | number | boolean
|
||||
>false : boolean
|
||||
|
||||
let z: string | number | boolean = false;
|
||||
>z : string | number | boolean
|
||||
>false : boolean
|
||||
|
||||
if (y = "", typeof x === "string") {
|
||||
>y = "", typeof x === "string" : boolean
|
||||
>y = "" : string
|
||||
>y : string | number | boolean
|
||||
>"" : string
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | number | boolean
|
||||
>"string" : string
|
||||
|
||||
x; // string
|
||||
>x : string
|
||||
|
||||
y; // string
|
||||
>y : string
|
||||
|
||||
z; // boolean
|
||||
>z : boolean
|
||||
}
|
||||
else if (z = 1, typeof x === "number") {
|
||||
>z = 1, typeof x === "number" : boolean
|
||||
>z = 1 : number
|
||||
>z : string | number | boolean
|
||||
>1 : number
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : number | boolean
|
||||
>"number" : string
|
||||
|
||||
x; // number
|
||||
>x : number
|
||||
|
||||
y; // string
|
||||
>y : string
|
||||
|
||||
z; // number
|
||||
>z : number
|
||||
}
|
||||
else {
|
||||
x; // boolean
|
||||
>x : boolean
|
||||
|
||||
y; // string
|
||||
>y : string
|
||||
|
||||
z; // number
|
||||
>z : number
|
||||
}
|
||||
x; // string | number | boolean
|
||||
>x : string | number | boolean
|
||||
|
||||
y; // string
|
||||
>y : string
|
||||
|
||||
z; // number | boolean
|
||||
>z : boolean | number
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user