fix(runtime): link cluster default to EventEmitter prototype - #9905
fix(runtime): link cluster default to EventEmitter prototype#9905proggeramlug wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe ChangesCluster default prototype
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The cluster default export now matches Node’s EventEmitter prototype behavior while retaining its cached singleton. The targeted regression coverage supports merge readiness. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed on |
The
node:clusterdefault export reportedcluster instanceof EventEmitter === truethrough a special case, but its actual[[Prototype]]was stillObject.prototype. As a result,Object.getPrototypeOf(cluster) === EventEmitter.prototypereturnedfalse, unlike Node.This routes every cluster default-export lookup through the cached cluster singleton, materializes the canonical
EventEmitter.prototypeunder runtime handles, and records it as the singleton's prototype once. Cluster event-method chaining keeps returning the same cached object.Refs #9202.
Validation:
cluster::cluster_default_prototype_tests::default_export_inherits_from_event_emitterperry-runtimesuite: 3,243 passed, 4 ignored; doc tests 8 ignored./run_parity_tests.sh --suite node-suite --filter cluster/exports/prototypes: 1/1 passed against Node 26.5.1./scripts/run_lint_gates.sh: all 64 gates passed, 2 CI-only skippedSummary by CodeRabbit
node:clusterdefault export so it inherits from the canonicalEventEmitterprototype.