mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
29 lines
473 B
TypeScript
29 lines
473 B
TypeScript
// @useUnknownInCatchVariables: true,false
|
|
|
|
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
|
|
}
|
|
}
|