Skip to content

AbortController.signal.addEventListener does not handle capture option #51703

@krutoo

Description

@krutoo

Version

v20.11.0

Platform

Linux petrov-dm 6.5.0-15-generic #15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 12 18:54:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Run code:

const controller = new AbortController();

controller.signal.addEventListener('abort', () => {
  console.log('foo');
});

controller.signal.addEventListener(
  'abort',
  () => {
    console.log('bar');
  },
  { capture: true },
);

controller.abort();

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

No response

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

expected output (like in firefox):

bar
foo

What do you see instead?

actual output:

foo
bar

Additional information

In Firefox there is properly behavior but i dont know how this described in specifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions