mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
55 lines
1.0 KiB
TypeScript
55 lines
1.0 KiB
TypeScript
//// [tests/cases/conformance/controlFlow/controlFlowAliasingCatchVariables.ts] ////
|
|
|
|
//// [controlFlowAliasingCatchVariables.ts]
|
|
try {}
|
|
catch (e) {
|
|
const isString = typeof e === 'string';
|
|
if (isString) {
|
|
e.toUpperCase(); // e string
|
|
}
|
|
|
|
if (typeof e === 'string') {
|
|
e.toUpperCase(); // e string
|
|
}
|
|
}
|
|
|
|
try {}
|
|
catch (e) {
|
|
const isString = typeof e === 'string';
|
|
|
|
e = 1;
|
|
|
|
if (isString) {
|
|
e.toUpperCase(); // e any/unknown
|
|
}
|
|
|
|
if (typeof e === 'string') {
|
|
e.toUpperCase(); // e string
|
|
}
|
|
}
|
|
|
|
|
|
//// [controlFlowAliasingCatchVariables.js]
|
|
"use strict";
|
|
try { }
|
|
catch (e) {
|
|
const isString = typeof e === 'string';
|
|
if (isString) {
|
|
e.toUpperCase(); // e string
|
|
}
|
|
if (typeof e === 'string') {
|
|
e.toUpperCase(); // e string
|
|
}
|
|
}
|
|
try { }
|
|
catch (e) {
|
|
const isString = typeof e === 'string';
|
|
e = 1;
|
|
if (isString) {
|
|
e.toUpperCase(); // e any/unknown
|
|
}
|
|
if (typeof e === 'string') {
|
|
e.toUpperCase(); // e string
|
|
}
|
|
}
|