code: function eventSpyBefore(eventType) {
                      /* jshint validthis: true */
                      var path = phantomas.getDOMPath(this);
                      //phantomas.log('DOM event: "' + eventType + '" bound to "' + path + '"');
  
                      phantomas.incrMetric('eventsBound');
                      phantomas.addOffender('eventsBound', '"%s" bound to "%s"', eventType, path);
                      phantomas.log('event ' + eventType + ' bound');
  
                      phantomas.enterContext({
                          type: 'addEventListener',
                          callDetails: {
                              context: {
                                  length: 1,
                                  elements: [path]
                              },
                              arguments: [eventType]
                          },
                          backtrace: phantomas.getBacktrace()
                      });
  
                      // count window.addEventListener('scroll', ...) - issue #508
                      if (eventType === 'scroll' && (path === 'window' || path === '#document')) {
                          phantomas.incrMetric('eventsScrollBound');
                          phantomas.addOffender('eventsScrollBound', 'bound by %s on %s', phantomas.getBacktrace(), path);
                      }
                  }
docs: spy calls to EventTarget.addEventListener @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener