Skip to content

fix(node:events): make streams instanceof EventEmitter#2238

Open
andrewtdiz wants to merge 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-stream-eventemitter-instanceof
Open

fix(node:events): make streams instanceof EventEmitter#2238
andrewtdiz wants to merge 2 commits into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-stream-eventemitter-instanceof

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • map native EventEmitter instanceof checks to a reserved class-id path
  • treat classic stream instances and legacy Stream.prototype as EventEmitter instances in that path
  • register a stdlib EventEmitter handle probe and add a parity fixture for new EventEmitter() instanceof EventEmitter

Verification

  • perl -e 'alarm shift; exec @argv' 180 ./run_parity_tests.sh --suite=node-suite --module=stream --filter events/captureRejections-symbol (PASS, report test-parity/reports/parity_report_20260528_072130.json)
  • perl -e 'alarm shift; exec @argv' 180 ./run_parity_tests.sh --suite=node-suite --module=stream --filter meta/instanceof-eventemitter (PASS, report test-parity/reports/parity_report_20260528_072319.json)
  • perl -e 'alarm shift; exec @argv' 180 ./run_parity_tests.sh --suite=node-suite --module=stream --filter meta/stream-prototype-ee (PASS, report test-parity/reports/parity_report_20260528_072328.json)
  • perl -e 'alarm shift; exec @argv' 180 ./run_parity_tests.sh --suite=node-suite --module=stream --filter events/captureRejection-symbol-fn (PASS, report test-parity/reports/parity_report_20260528_072337.json)
  • perl -e 'alarm shift; exec @argv' 180 ./run_parity_tests.sh --suite=node-suite --module=events --filter emitter/instanceof (PASS, report test-parity/reports/parity_report_20260528_072415.json)
  • cargo test -p perry-runtime stream_dynamic_instanceof_follows_node_stream_inheritance
  • cargo test -p perry-runtime legacy_stream_prototype_is_event_emitter_instanceof_candidate
  • cargo check -p perry-runtime -p perry-stdlib -p perry-codegen
  • cargo fmt --check
  • jq empty test-parity/known_failures.json
  • git diff --check

Notes

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