Skip to content

path.posix / path.win32 sub-namespace methods return undefined (last gap before path PASS) #810

Description

@proggeramlug

Repro

import * as path from "node:path";
console.log("posix.join:", path.posix.join("/foo", "bar"));
console.log("posix.sep:", path.posix.sep);
console.log("win32.join:", path.win32.join("C:\\foo", "bar"));
console.log("win32.sep:", path.win32.sep);

Actual (Perry v0.5.910)

posix.join: undefined
posix.sep: /
win32.join: undefined
win32.sep: \

Expected (Node)

posix.join: /foo/bar
posix.sep: /
win32.join: C:\foo\bar
win32.sep: \

Analysis

path.posix and path.win32 are sub-namespace objects that mirror the full path API but force POSIX / Windows semantics respectively. After #741 landed, the top-level path.* functions all work — but the path.posix / path.win32 sub-objects only have their data properties populated (sep, delimiter resolve correctly) while their function properties (join, resolve, basename, dirname, normalize, etc.) are undefined.

So this is a sub-namespace function-population gap, distinct from #741's top-level fixes. Same family as #629 (namespace member visibility) but one level down.

path.win32.* is heavily used by cross-platform tooling that needs to manipulate Windows paths from a POSIX host (build tools, bundlers, path normalizers). path.posix.* similarly for the reverse.

Why this matters now

This is the only remaining divergence in test-files/test_parity_path.ts — diff is down to 2 changed lines (posix.join + win32.join), both this bug. Fixing it makes test_parity_path a full byte-for-byte PASS, joining test_parity_os, test_parity_tty, and test_parity_async_local_storage.

Acceptance

The 4-line repro prints output matching Node. (path.posix.join and path.win32.join are the canonical probes; ideally the whole posix/win32 function surface is populated, not just join.)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions