| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent afe39ed commit 96566fc
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -168,6 +168,10 @@ class Event { | |||
| 168 | 168 | stopImmediatePropagation() { | |
| 169 | 169 | if (!isEvent(this)) | |
| 170 | 170 | throw new ERR_INVALID_THIS('Event'); | |
| 171 | + // Spec mention "stopImmediatePropagation should set both "stop propagation" | ||
| 172 | + // and "stop immediate propagation" flags" | ||
| 173 | + // cf: from https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation | ||
| 174 | + this.stopPropagation(); | ||
| 171 | 175 | this[kStop] = true; | |
| 172 | 176 | } | |
| 173 | 177 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -345,7 +345,9 @@ let asyncTest = Promise.resolve(); | |||
| 345 | 345 | { | |
| 346 | 346 | const target = new EventTarget(); | |
| 347 | 347 | const event = new Event('foo'); | |
| 348 | + strictEqual(event.cancelBubble, false); | ||
| 348 | 349 | event.stopImmediatePropagation(); | |
| 350 | + strictEqual(event.cancelBubble, true); | ||
| 349 | 351 | target.addEventListener('foo', common.mustNotCall()); | |
| 350 | 352 | target.dispatchEvent(event); | |
| 351 | 353 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments