fix(hir): preserve computed field key scope - #10909
proggeramlug wants to merge 1 commit into
Conversation
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change prevents computed instance-field keys from being collected or rewritten as constructor captures. The HIR documentation describes definition-time key storage. A regression test verifies capture behavior for nested classes with symbol-keyed fields. ChangesComputed Field Capture Handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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 via merge train 253 (#10918) as v0.5.1633 — merge commit Expedited at the owner's request. Carried with nine other PRs; the stacked ones (#10899/#10900 on #10886, #10901 on #10885) had only their unique commits taken. Evidence on the assembled tree: Closing here rather than merging — a train lands the commits directly. |
Closes #10889
Root cause
Class capture synthesis treated computed instance-field key expressions as constructor-time work. In nested and CommonJS-wrapped classes it remapped those expressions to synthetic constructor capture parameters, but ClassDefinitionEvaluation executes the key snapshots outside the constructor, where those parameters are unbound.
In undici's
PoolBase,[kClients] = []was consequently installed under the wrong key.Poollater read the realkClientssymbol and failed atthis[kClients].length(pool.js:101).Fix
Validation
cargo test -p perry-hir lower::tests --lib(102 passed, 1 ignored)python3 scripts/check_test_registration.pygit diff --checkundici@8.9.0public-entry fixture: the reportedPool[kClients]failure atpool.js:101is goneThe fixture advances to a separate Node stream contract failure:
Socket.read()returnsundefinedinstead ofnull, causing a laterchunk.lengthfailure atclient-h1.js:323. That next blocker is tracked independently in #10908.Summary by CodeRabbit
Bug Fixes
Tests