summaryrefslogtreecommitdiff
path: root/test/fixtures/source-map/babel-throw-original.js
blob: 779bd16fd4611dc96d5d55891f61378e9ee4f86e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*---
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);