Skip to content

napi: keep async cleanup hook handles alive until the addon removes them - #37204

Merged
Jarred-Sumner merged 5 commits into
mainfrom
farm/78bea1bc/napi-async-cleanup-hook-handle-uaf
Aug 9, 2026
Merged

napi: keep async cleanup hook handles alive until the addon removes them#37204
Jarred-Sumner merged 5 commits into
mainfrom
farm/78bea1bc/napi-async-cleanup-hook-handle-uaf

Trim comments, make removeAsyncCleanupHook void, pin expected test ou…

5365c7a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 8, 2026 in 12m 59s

Code review found 1 important issue

Found 2 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important test/napi/napi.test.ts:1745-1752 toEndWith assertion fails on Windows due to CRLF from printf

Annotations

Check failure on line 1752 in test/napi/napi.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

toEndWith assertion fails on Windows due to CRLF from printf

This `toEndWith([...].join("\n"))` will fail on Windows: the fixture prints via `printf("...\n")`, which the MSVC CRT translates to `\r\n`, and `checkSameOutput` only `.trim()`s the ends — the three internal `\r\n` separators survive. Match the sibling convention in this file (see line ~1697 / 943 / 751) and normalize first, e.g. `expect(output.split(/\r?\n/).slice(-4)).toEqual([...])`.