src/printer.js
function isTryBody(path, {stackOffset = 0} = {}) {
  const node = path.getParentNode(stackOffset - 1)
  const parent = path.getParentNode(stackOffset)
  const grandparent = path.getParentNode(stackOffset + 1)
  const greatgrandparent = path.getParentNode(stackOffset + 2)

  if (parent.type === 'TryStatement' && node === parent.block) {
    return true
  }

  if (
    singleExpressionBlock(parent) &&
    grandparent.type === 'TryStatement' &&
    parent === grandparent.block
  ) {
    return true
  }

  if (
    parent.type === 'ExpressionStatement' &&
    singleExpressionBlock(grandparent) &&
    greatgrandparent.type === 'TryStatement' &&
    grandparent === greatgrandparent.block
  ) {
    return true
  }

  return false
}
function isTryBody(path, {stackOffset = 0} = {}) {
  const node = path.getParentNode(stackOffset - 1)
  const parent = path.getParentNode(stackOffset)
  const grandparent = path.getParentNode(stackOffset + 1)
  const greatgrandparent = path.getParentNode(stackOffset + 2)

  if (parent.type === 'TryStatement' && node === parent.block) {
    return true
  }

  if (
    singleExpressionBlock(parent) &&
    grandparent.type === 'TryStatement' &&
    parent === grandparent.block
  ) {
    return true
  }

  if (
    parent.type === 'ExpressionStatement' &&
    singleExpressionBlock(grandparent) &&
    greatgrandparent.type === 'TryStatement' &&
    grandparent === greatgrandparent.block
  ) {
    return true
  }

  return false
}
eslint-disable-next-line no-unused-vars