Skip to content

4.4 branch: Guard against odd object prototypes triggered by changes in TOML 4.0#916

Merged
jdmarshall merged 2 commits into
node-config:4.4from
jdmarshall:tomlFix
Jun 26, 2026
Merged

4.4 branch: Guard against odd object prototypes triggered by changes in TOML 4.0#916
jdmarshall merged 2 commits into
node-config:4.4from
jdmarshall:tomlFix

Conversation

@jdmarshall

@jdmarshall jdmarshall commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

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

Fixes #911

Summary by CodeRabbit

  • Bug Fixes

    • Improved object immutability property detection to use more reliable methods.
  • Chores

    • Updated continuous integration workflow to include additional branch for automated testing.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f58e2ffa-3389-4a5e-ab24-6989c6c74f33

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title directly references the core issue being addressed: guarding against odd object prototypes caused by TOML 4.0 changes. It clearly summarizes the main change and the specific problem context.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread lib/util.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
lib/util.js (1)

189-191: ⚡ Quick win

Remove unused ownProps variable.

The ownProps array 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).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 32190c04-7633-4b41-bdf7-3eedc0cd3788

📥 Commits

Reviewing files that changed from the base of the PR and between 890084d and 43ea2c9.

📒 Files selected for processing (1)
  • lib/util.js

@jdmarshall jdmarshall changed the title Guard against odd object prototypes triggered by changes in TOML 4.0 4.4 branch: Guard against odd object prototypes triggered by changes in TOML 4.0 Jun 10, 2026
@jdmarshall
jdmarshall force-pushed the tomlFix branch 2 times, most recently from 2b9786c to 93755f2 Compare June 13, 2026 05:46
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
@jdmarshall
jdmarshall merged commit 1537469 into node-config:4.4 Jun 26, 2026
4 checks passed
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