4.4 branch: Guard against odd object prototypes triggered by changes in TOML 4.0#916
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/util.js (1)
189-191: ⚡ Quick winRemove unused
ownPropsvariable.The
ownPropsarray is computed but never referenced. This appears to be leftover code from refactoring.🧹 Proposed fix to remove dead code
- const ownProps = [ - ...Object.getOwnPropertyNames(target), - ] - // Bypass proxy receiver for properties directly on the target (e.g., RegExp.prototype.source)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/util.js` around lines 189 - 191, Remove the dead-variable declaration for ownProps in the function where target is used: delete the const ownProps = [...Object.getOwnPropertyNames(target)] line (and any related unused references) so the code no longer computes an unused array; ensure no other logic depends on ownProps and keep existing behavior of the surrounding function (refer to the ownProps identifier and the target parameter to locate the statement).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@lib/util.js`:
- Around line 189-191: Remove the dead-variable declaration for ownProps in the
function where target is used: delete the const ownProps =
[...Object.getOwnPropertyNames(target)] line (and any related unused references)
so the code no longer computes an unused array; ensure no other logic depends on
ownProps and keep existing behavior of the surrounding function (refer to the
ownProps identifier and the target parameter to locate the statement).
2b9786c to
93755f2
Compare
Note that test in 0-util.js:
assert.deepStrictEqual(result.config.messages, [...
Still fails with toml 4.1 because there is no prototype on messages, which is problematic
Note that test in 0-util.js:
Still fails with toml 4.1 because there is no prototype on messages, which is problematic
Fixes #911
Summary by CodeRabbit
Bug Fixes
Chores