node/test/fixtures/source-map/babel-throw-original.js
bcoe e1e2f669f6
process: add source-map support to stack traces
PR-URL: https://github.com/nodejs/node/pull/29564
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-10-05 17:08:00 -07:00

20 lines
298 B
JavaScript

/*---
esid: prod-OptionalExpression
features: [optional-chaining]
---*/
const obj = {
a: {
b: 22
}
};
function fn () {
return {};
}
setTimeout((err) => {
// OptionalExpression (MemberExpression OptionalChain) OptionalChain
if (obj?.a?.b === 22) throw Error('an exception');
}, 5);