diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 67a84f55853770..9d9ad1f222b903 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -310,7 +310,7 @@ class Event { if (!isEvent(this)) throw new ERR_INVALID_THIS('Event'); if (value) { - this.stopPropagation(); + this.#propagationStopped = true; } } diff --git a/test/parallel/test-eventtarget.js b/test/parallel/test-eventtarget.js index 193c47893b5a9e..aaead823d032b8 100644 --- a/test/parallel/test-eventtarget.js +++ b/test/parallel/test-eventtarget.js @@ -738,3 +738,10 @@ let asyncTest = Promise.resolve(); controller.abort(); et.dispatchEvent(new Event('foo')); } + +{ + const event = new Event('foo'); + strictEqual(event.cancelBubble, false); + event.cancelBubble = true; + strictEqual(event.cancelBubble, true); +}