code: function Promise(resolver) {
    if (!(this instanceof InstrumentedPromise)) {
      throw new TypeError('Cannot call a class as a function');
    }
    const promise = new OriginalPromise((resolve, reject) =>
      resolver(resolve, arg => {
        OriginalPromise.resolve().then(() => {
          if (promise._hasDownstreams === undefined) {
            dispatchUnhandledRejectionEvent(promise, arg);
          }
        });
        return reject(arg);
      }));
    promise.__proto__ = InstrumentedPromise.prototype;
    return promise;
  }
docs: ES5 subclassing is used per:
  https://github.com/rtsao/browser-unhandled-rejection/issues/1
  https://kangax.github.io/compat-table/es6/#test-Promise_is_subclassable
  
  Adapted from: https://gist.github.com/domenic/8ed6048b187ee8f2ec75