You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
entry[0] typeof: object
entry[0] is string: false
entry[0].isFile type: function
Readable.from typeof: object
Readable.from .on type: function
Readable.from .pipe type: function
new Readable .on type: function
new Readable .pipe type: function
Impact
Two related symptoms:
fs.readdirSync(path, { withFileTypes: true }) silently ignores the option and returns string entries instead of Dirent objects. Code patterns like const dirs = entries.filter(e => e.isDirectory()) crash with (string).isDirectory is not a function.
stream.Readable.from(...) and new stream.Readable({read}) return undefined (or an object with no prototype methods) — the entire Readable / Writable / Duplex / Transform class hierarchy is unusable downstream, even though the constructors exist. This was the dominant cause of test-files/test_parity_stream.ts reaching 97% divergence: nothing built on top of these primitives works.
The grouping of these as "one issue" is the architectural shape: native Perry classes that wrap runtime objects need their prototype-method dispatch wired to the underlying instance (the FFI registry / handle table). Without that wiring, the constructor returns either a raw handle (Dirent → string) or undefined (Readable.from), and downstream property access fails.
Acceptance
The repro above prints output byte-identical to Node.
Related
Surfaced via test-files/test_parity_fs.ts (Stats / Dirent / fsPromises FileHandle methods all undefined) and test-files/test_parity_stream.ts (Readable / Writable / Duplex / Transform instance methods all undefined).
Repro
Actual (Perry)
Expected (Node)
Impact
Two related symptoms:
fs.readdirSync(path, { withFileTypes: true })silently ignores the option and returns string entries instead of Dirent objects. Code patterns likeconst dirs = entries.filter(e => e.isDirectory())crash with(string).isDirectory is not a function.stream.Readable.from(...)andnew stream.Readable({read})returnundefined(or an object with no prototype methods) — the entire Readable / Writable / Duplex / Transform class hierarchy is unusable downstream, even though the constructors exist. This was the dominant cause oftest-files/test_parity_stream.tsreaching 97% divergence: nothing built on top of these primitives works.The grouping of these as "one issue" is the architectural shape: native Perry classes that wrap runtime objects need their prototype-method dispatch wired to the underlying instance (the FFI registry / handle table). Without that wiring, the constructor returns either a raw handle (Dirent → string) or undefined (Readable.from), and downstream property access fails.
Acceptance
The repro above prints output byte-identical to Node.
Related
test-files/test_parity_fs.ts(Stats / Dirent / fsPromises FileHandle methods all undefined) andtest-files/test_parity_stream.ts(Readable / Writable / Duplex / Transform instance methods all undefined).typeof processnumeric tag) — a class-instance value getting a wrong NaN-box tag at the construction boundary so downstream property lookups fall through.