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: improve AbortController creation duration · nodejs/node@5745bcb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal
    • abort_controller.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
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,20 +309,21 @@ function abortSignal(signal, reason) {
309309
}
310310

311311
class AbortController {
312-
#signal = createAbortSignal();
312+
#signal;
313313

314314
/**
315315
* @type {AbortSignal}
316316
*/
317317
get signal() {
318+
this.#signal ??= createAbortSignal();
318319
return this.#signal;
319320
}
320321

321322
/**
322323
* @param {any} reason
323324
*/
324325
abort(reason = new DOMException('This operation was aborted', 'AbortError')) {
325-
abortSignal(this.#signal, reason);
326+
abortSignal(this.#signal ??= createAbortSignal(), reason);
326327
}
327328

328329
[customInspectSymbol](depth, options) {

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.