code: function htmlTreeAsString (elem) {
    var MAX_TRAVERSE_HEIGHT = 5
    var MAX_OUTPUT_LEN = 80
    var out = []
    var height = 0
    var len = 0
    var separator = ' > '
    var sepLength = separator.length
    var nextStr
  
    while (elem && height++ < MAX_TRAVERSE_HEIGHT) {
      nextStr = htmlElementAsString(elem)
      // bail out if
      // - nextStr is the 'html' element
      // - the length of the string that would be created exceeds MAX_OUTPUT_LEN
      //   (ignore this limit if we are on the first iteration)
      if (
        nextStr === 'html' ||
        (height > 1 &&
         len + (out.length * sepLength) + nextStr.length >= MAX_OUTPUT_LEN)
      ) {
        break
      }
  
      out.push(nextStr)
  
      len += nextStr.length
      elem = elem.parentNode
    }
  
    return out.reverse().join(separator)
  }
docs: ORIGINAL SOURCE: https://github.com/getsentry/raven-js/
  Given a child DOM element, returns a query-selector statement describing that
  and its ancestors
  e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
  @param elem
  @returns {string}