Adding regression test

This commit is contained in:
Anders Hejlsberg
2016-04-25 21:24:42 -07:00
parent ecc936167f
commit 6cd7db8257
4 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
//// [defaultOfAnyInStrictNullChecks.ts]
// Regression test for #8295
function foo() {
try {
}
catch (e) {
let s = e.message;
}
}
//// [defaultOfAnyInStrictNullChecks.js]
// Regression test for #8295
function foo() {
try {
}
catch (e) {
var s = e.message;
}
}

View File

@@ -0,0 +1,18 @@
=== tests/cases/compiler/defaultOfAnyInStrictNullChecks.ts ===
// Regression test for #8295
function foo() {
>foo : Symbol(foo, Decl(defaultOfAnyInStrictNullChecks.ts, 0, 0))
try {
}
catch (e) {
>e : Symbol(e, Decl(defaultOfAnyInStrictNullChecks.ts, 6, 11))
let s = e.message;
>s : Symbol(s, Decl(defaultOfAnyInStrictNullChecks.ts, 7, 11))
>e : Symbol(e, Decl(defaultOfAnyInStrictNullChecks.ts, 6, 11))
}
}

View File

@@ -0,0 +1,20 @@
=== tests/cases/compiler/defaultOfAnyInStrictNullChecks.ts ===
// Regression test for #8295
function foo() {
>foo : () => void
try {
}
catch (e) {
>e : any
let s = e.message;
>s : any
>e.message : any
>e : any
>message : any
}
}

View File

@@ -0,0 +1,11 @@
// @strictNullChecks: true
// Regression test for #8295
function foo() {
try {
}
catch (e) {
let s = e.message;
}
}