Skip to content

events: setting Event.cancelBubble calls stopPropagation #50401

Closed
@KhafraDev

Description

@KhafraDev

Version

v22

Platform

Linux DESKTOP-L4O1H93 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

events

What steps will reproduce the bug?

const ev = new Event('')
ev.stopPropagation = () => {
  console.log('???')
}

ev.cancelBubble = true

How often does it reproduce? Is there a required condition?

n/a

What is the expected behavior? Why is that the expected behavior?

nothing to be printed

What do you see instead?

???

Additional information

set cancelBubble(value) {
if (!isEvent(this))
throw new ERR_INVALID_THIS('Event');
if (value) {
this.stopPropagation();
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    eventtargetIssues and PRs related to the EventTarget implementation.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions