Skip to content

[codex] expose stream class static values#4346

Draft
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-stream-class-static-exports
Draft

[codex] expose stream class static values#4346
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-stream-class-static-exports

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

Refs #2521.

This fixes the remaining node:stream class static value-read surface where direct compiler-recognized static calls worked, but property reads and captured references returned undefined.

  • Attach callable static method values to Readable, Writable, Duplex, Transform, and PassThrough constructors with Node-compatible .length values.
  • Route captured static references through the existing stream runtime helpers, with shape-stable toWeb method-value wrappers for detached calls.
  • Add a focused Node/Perry parity fixture for static reads, namespace identity, captured references, and detached helper calls.

This does not change the broader adapter data-flow, cancel/error/backpressure behavior, or stream iterator-helper behavior.

Validation

  • timeout 30 npm exec --yes --package=node@26 -- node --experimental-strip-types test-parity/node-suite/stream/static/class-static-exports.ts > /tmp/node_stream_static_exports.out
  • PERRY_NO_AUTO_OPTIMIZE=1 target/debug/perry test-parity/node-suite/stream/static/class-static-exports.ts -o /tmp/perry_stream_static_exports
  • timeout 30 /tmp/perry_stream_static_exports > /tmp/perry_stream_static_exports.out
  • diff -u /tmp/node_stream_static_exports.out /tmp/perry_stream_static_exports.out
  • cargo test -p perry-runtime stream_constructors_expose_static_method_values --lib
  • cargo build -p perry-runtime -p perry-stdlib
  • cargo fmt --all -- --check
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant