Context
Perry's node:path runtime implements POSIX semantics (path.basename, path.dirname, path.parse, etc.) but does NOT expose the path.win32 sub-namespace — path.win32.<method> resolves to undefined on every method/property read, so any code path that depends on Windows-style separator handling (\\), drive letters (C:\\…), or UNC paths (\\\\server\\share) crashes or produces wrong output.
Surfaced by the granular node-suite/path/win32/* fixtures added under the per-method parity coverage work — five tests currently fail and are skip-listed in test-parity/known_failures.json pointing at this issue.
Scope
Implement the path.win32 namespace mirror of every POSIX method Perry already supports:
path.win32.basename(p, [ext])
path.win32.dirname(p)
path.win32.extname(p)
path.win32.format({root, dir, base, name, ext})
path.win32.isAbsolute(p)
path.win32.join(...segments)
path.win32.normalize(p)
path.win32.parse(p) → {root, dir, base, name, ext}
path.win32.relative(from, to)
path.win32.resolve(...segments)
path.win32.sep (\\) and path.win32.delimiter (;) constants
path.win32.toNamespacedPath(p)
path.win32.matchesGlob(p, glob)
Plus the Windows-specific rules each method enforces:
- Drive letters (
C:\\foo) are absolute roots; relative-to-drive (C:foo) preserves the drive prefix without making the path absolute.
- UNC paths (
\\\\server\\share\\…) keep the four-character root.
\\\\?\\ device prefix paths are passed through normalize / parse intact.
- Both
\\ and / count as separators on Windows.
Acceptance criterion
./run_parity_tests.sh --suite node-suite --module path reports PASS for all five win32 fixtures byte-for-byte against node --experimental-strip-types:
node-suite/path/win32/basename-dirname
node-suite/path/win32/join-normalize
node-suite/path/win32/parse-format
node-suite/path/win32/relative-resolve
node-suite/path/win32/unc-and-drive
Remove the matching entries from test-parity/known_failures.json once the implementation lands.
Out of scope
path.posix is already wired (see crates/perry-runtime/src/path.rs); only the win32 mirror is missing.
Context
Perry's
node:pathruntime implements POSIX semantics (path.basename,path.dirname,path.parse, etc.) but does NOT expose thepath.win32sub-namespace —path.win32.<method>resolves toundefinedon every method/property read, so any code path that depends on Windows-style separator handling (\\), drive letters (C:\\…), or UNC paths (\\\\server\\share) crashes or produces wrong output.Surfaced by the granular
node-suite/path/win32/*fixtures added under the per-method parity coverage work — five tests currently fail and are skip-listed intest-parity/known_failures.jsonpointing at this issue.Scope
Implement the
path.win32namespace mirror of every POSIX method Perry already supports:path.win32.basename(p, [ext])path.win32.dirname(p)path.win32.extname(p)path.win32.format({root, dir, base, name, ext})path.win32.isAbsolute(p)path.win32.join(...segments)path.win32.normalize(p)path.win32.parse(p)→{root, dir, base, name, ext}path.win32.relative(from, to)path.win32.resolve(...segments)path.win32.sep(\\) andpath.win32.delimiter(;) constantspath.win32.toNamespacedPath(p)path.win32.matchesGlob(p, glob)Plus the Windows-specific rules each method enforces:
C:\\foo) are absolute roots; relative-to-drive (C:foo) preserves the drive prefix without making the path absolute.\\\\server\\share\\…) keep the four-character root.\\\\?\\device prefix paths are passed through normalize / parse intact.\\and/count as separators on Windows.Acceptance criterion
./run_parity_tests.sh --suite node-suite --module pathreports PASS for all five win32 fixtures byte-for-byte againstnode --experimental-strip-types:node-suite/path/win32/basename-dirnamenode-suite/path/win32/join-normalizenode-suite/path/win32/parse-formatnode-suite/path/win32/relative-resolvenode-suite/path/win32/unc-and-driveRemove the matching entries from
test-parity/known_failures.jsononce the implementation lands.Out of scope
path.posixis already wired (seecrates/perry-runtime/src/path.rs); only the win32 mirror is missing.