GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: let abort_controller target be EventTarget · nodejs/node@d2f574b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal
    • abort_controller.js
    • event_target.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/abort_controller.js‎

Copy file name to clipboardExpand all lines: lib/internal/abort_controller.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const {
1010
} = primordials;
1111

1212
const {
13+
defineEventHandler,
1314
EventTarget,
1415
Event,
1516
kTrustEvent
@@ -53,9 +54,6 @@ function abortSignal(signal) {
5354
const event = new Event('abort', {
5455
[kTrustEvent]: true
5556
});
56-
if (typeof signal.onabort === 'function') {
57-
signal.onabort(event);
58-
}
5957
signal.dispatchEvent(event);
6058
}
6159

@@ -67,6 +65,7 @@ class AbortController {
6765
constructor() {
6866
this[kSignal] = new AbortSignal();
6967
emitExperimentalWarning('AbortController');
68+
defineEventHandler(this[kSignal], 'abort');
7069
}
7170

7271
get signal() { return this[kSignal]; }
Collapse file

‎lib/internal/event_target.js‎

Copy file name to clipboardExpand all lines: lib/internal/event_target.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,13 @@ class EventTarget {
334334
}
335335
return event;
336336
};
337+
if (event !== undefined)
338+
event[kTarget] = this;
337339

338340
const root = this[kEvents].get(type);
339341
if (root === undefined || root.next === undefined)
340342
return true;
341343

342-
if (event !== undefined)
343-
event[kTarget] = this;
344-
345344
let handler = root.next;
346345
let next;
347346

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.