mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
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;
|
||
|
}
|