Add test for catch block without variable

This commit is contained in:
Ron Buckton
2018-01-17 11:25:53 -08:00
parent 2ba29d8d9d
commit e655446318
4 changed files with 58 additions and 2 deletions

View File

@@ -210,7 +210,17 @@ async function fn39(x) {
var x;
break foo;
}
}
}
async function fn40(x) {
try {
}
catch {
var x;
}
}
//// [asyncWithVarShadowing_es6.js]
function fn1(x) {
@@ -476,3 +486,12 @@ function fn39(x) {
});
var x;
}
function fn40(x) {
return __awaiter(this, void 0, void 0, function* () {
try {
}
catch (_a) {
}
});
var x;
}

View File

@@ -416,3 +416,17 @@ async function fn39(x) {
break foo;
}
}
async function fn40(x) {
>fn40 : Symbol(fn40, Decl(asyncWithVarShadowing_es6.ts, 211, 1))
>x : Symbol(x, Decl(asyncWithVarShadowing_es6.ts, 213, 20), Decl(asyncWithVarShadowing_es6.ts, 218, 11))
try {
}
catch {
var x;
>x : Symbol(x, Decl(asyncWithVarShadowing_es6.ts, 213, 20), Decl(asyncWithVarShadowing_es6.ts, 218, 11))
}
}

View File

@@ -423,3 +423,17 @@ async function fn39(x) {
>foo : any
}
}
async function fn40(x) {
>fn40 : (x: any) => Promise<void>
>x : any
try {
}
catch {
var x;
>x : any
}
}

View File

@@ -211,4 +211,13 @@ async function fn39(x) {
var x;
break foo;
}
}
}
async function fn40(x) {
try {
}
catch {
var x;
}
}