Re: [whatwg/dom] Could a property be exposed so I can observe `.stopImmediatePropagation()`? (#958)

I could, but it's a little awkward, especially when implementations already necessarily need the data and could expose it in approximately the same number of lines of code:

```js
// Here's a polyfill for that above `e.immediatePropagationStopped`
;(function() {
const _immediatePropagationStopped = new WeakSet()
const stopImmediatePropagation = Event.prototype.stopImmediatePropagation
Event.prototype.stopImmediatePropagation = function () {
    const result = stopImmediatePropagation.apply(this, arguments)
    _immediatePropagationStopped.add(this)
    return result
}
Object.defineProperty(Event.prototype, "immediatePropagationStopped", {
    configurable: true,
    enumerable: true,
    get: function immediatePropagationStopped() { return _immediatePropagationStopped.has(this) }
})
})();
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/958#issuecomment-793562155

Received on Tuesday, 9 March 2021 08:46:08 UTC