mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
34 lines
417 B
TypeScript
34 lines
417 B
TypeScript
//// [tests/cases/compiler/flowInFinally1.ts] ////
|
|
|
|
//// [flowInFinally1.ts]
|
|
class A {
|
|
constructor() { }
|
|
method() { }
|
|
}
|
|
|
|
let a: A | null = null;
|
|
|
|
try {
|
|
a = new A();
|
|
} finally {
|
|
if (a) {
|
|
a.method();
|
|
}
|
|
}
|
|
|
|
//// [flowInFinally1.js]
|
|
"use strict";
|
|
class A {
|
|
constructor() { }
|
|
method() { }
|
|
}
|
|
let a = null;
|
|
try {
|
|
a = new A();
|
|
}
|
|
finally {
|
|
if (a) {
|
|
a.method();
|
|
}
|
|
}
|