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 — test: keep objects alive in finalization fixtures · nodejs/node@674fc34

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/fixtures/process
    • finalization-cleanup.mjs
    • unregister-function.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/fixtures/process/finalization-cleanup.mjs‎

Copy file name to clipboardExpand all lines: test/fixtures/process/finalization-cleanup.mjs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ for (let i = 0; i < 10; i++) {
3030
}
3131

3232
process.on('exit', function () {
33+
// Keep `first` and `third` alive until exit; registrations only hold them weakly.
34+
deepStrictEqual(keptAlive.map((obj) => obj.name), ['first', 'third'])
3335
deepStrictEqual(finalized, ['first', 'third'])
3436
})
Collapse file

‎test/fixtures/process/unregister-function.mjs‎

Copy file name to clipboardExpand all lines: test/fixtures/process/unregister-function.mjs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ unregisterABeforeExit()
2525
unregisterBAgain()
2626

2727
process.on('exit', function () {
28+
// Keep `a` and `b` alive until exit; registrations only hold them weakly.
29+
strictEqual(a.name, 'a')
30+
strictEqual(b.name, 'b')
2831
strictEqual(calls.join(','), 'b:exit')
2932
})

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.