Commit Graph

6 Commits

Author SHA1 Message Date
Claude Bot
9c99a692c7 refactor: deduplicate 5 commonly repeated functions
This consolidates duplicate functions that were scattered across the codebase:

1. **Platform detection functions** (isWindows, isLinux, isMacOS, isPosix)
   - Created internal/platform.ts module for built-in JS modules
   - Updated test files to import from harness instead of redefining

2. **Patch test snapshot normalization**
   - Created harness-patch.ts for shared normalizeBunSnapshotForPatch
   - Consolidated identical implementations from 2 test files

3. **Removed inline isLinux redefinition**
   - net.ts was defining isLinux twice, now uses shared import

Files affected:
- src/js/internal/platform.ts (new shared module)
- src/js/internal/fs/glob.ts (use shared isWindows)
- src/js/node/net.ts (use shared isWindows and isLinux)
- test/harness-patch.ts (new shared test utility)
- test/cli/install/bun-install-patch.test.ts
- test/regression/issue/patch-bounds-check.test.ts
- test/js/node/test/common/index.js
- test/napi/node-napi-tests/test/common/index.js

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 06:13:12 +00:00
Meghan Denny
26cbcd21c1 test: split napi tests into separate files (#21475)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-29 22:33:19 -07:00
190n
03dfd7d96b Run callback passed to napi_module_register after dlopen returns instead of during call (#20478) 2025-07-24 11:46:56 -07:00
190n
61e03a2758 Switch back from quick_exit(134) to abort() in Windows crash handler (#20194) 2025-06-05 20:39:47 -07:00
190n
cde668b54c Better edge case handling in napi_value<->String conversion (#18107) 2025-03-12 18:15:00 -07:00
190n
efabdcbe1f Start fixing bugs discovered by Node.js's Node-API tests (#14501)
Co-authored-by: Kai Tamkun <kai@tamkun.io>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: 190n <190n@users.noreply.github.com>
2025-02-26 22:11:42 -08:00