mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
Adding regression test
This commit is contained in:
22
tests/baselines/reference/defaultOfAnyInStrictNullChecks.js
Normal file
22
tests/baselines/reference/defaultOfAnyInStrictNullChecks.js
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
11
tests/cases/compiler/defaultOfAnyInStrictNullChecks.ts
Normal file
11
tests/cases/compiler/defaultOfAnyInStrictNullChecks.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// @strictNullChecks: true
|
||||
|
||||
// Regression test for #8295
|
||||
|
||||
function foo() {
|
||||
try {
|
||||
}
|
||||
catch (e) {
|
||||
let s = e.message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user