Skip to content

Conversation

@godxiaoji
Copy link
Contributor

Refer to: https://github.com/vuejs/core/actions/runs/3458391480/jobs/5772768354

In test:

patchProp(child, 'onClick', null, () => {
  childFn()
  patchProp(el, 'onClick', null, parentFn)
})
child.dispatchEvent(new Event('click', { bubbles: true }))

The above code (including the event handler) is executed in the same loop in nodejs.

Because use the same timestamp for all event listeners attached in the same tick in createInvoker.
The attached timestamp of parentFn event will be earlier than the bubble event.
So the parentFn will have been called.

To avoid unstable tests, move dispatchEvent to next loop.

@pikax
Copy link
Member

pikax commented Oct 25, 2023

@pikax pikax closed this Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Rejected

Development

Successfully merging this pull request may close these issues.

2 participants