Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
Please see the reproduction. It seems zone.js assumes EventTarget's event call is always a standalone task, which may not be true.
const invoke = (fn) => {
document.body.addEventListener('click', fn);
document.body.click();
document.body.removeEventListener('click', fn);
};
invoke(() => {
Promise.resolve().then(() => console.log(2));
});
console.log(1);
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/typescript-88btqj?file=index.ts
Please provide the exception or error you saw
Native Chrome/Safari/Firefox outputs `1 2`, while with zone.js outputs `2 1`.
Please provide the environment you discovered this bug in (run ng version)
No response
Anything else?
I noticed this during debugging #41506 (comment) , maybe related.
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
Please see the reproduction. It seems zone.js assumes EventTarget's event call is always a standalone task, which may not be true.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/typescript-88btqj?file=index.ts
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version)No response
Anything else?
I noticed this during debugging #41506 (comment) , maybe related.