Accepting new baselines

This commit is contained in:
Anders Hejlsberg 2016-04-20 07:09:53 -07:00
parent 33e359ff13
commit bab8ef4b10
3 changed files with 176 additions and 0 deletions

View 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
}

View 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))
}

View 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
}