mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
bb544ba2f5
**Related issue:** - Closes https://github.com/swc-project/swc/issues/6405.
14 lines
338 B
JavaScript
14 lines
338 B
JavaScript
export const fn = () => {
|
|
let val;
|
|
|
|
if (!val) {
|
|
return undefined;
|
|
// works as expected if comment out below line
|
|
throw new Error('first');
|
|
}
|
|
|
|
if (val.a?.b !== true) { // Uncaught TypeError: Cannot read properties of undefined (reading 'a')
|
|
throw new Error('second');
|
|
}
|
|
return val;
|
|
} |