Skip to content

JS: Do not flag computed __proto__ properties - #22829

Open
eugeniodepalo wants to merge 1 commit into
github:mainfrom
eugeniodepalo:js/computed-proto-property
Open

eugeniodepalo wants to merge 1 commit into
github:mainfrom
eugeniodepalo:js/computed-proto-property

Conversation

@eugeniodepalo

Copy link
Copy Markdown

js/invalid-prototype-value reports { ["__proto__"]: 9 }, although a computed object-literal key creates an ordinary data property.

Exclude computed object-literal writes while retaining alerts for { "__proto__": 42 } and object["__proto__"] = 42.

Observed in gtkx-org/gtkx#658.

Validation: focused regression test, query formatting, and change-note release validation.

Computed object-literal keys define ordinary data properties. Exclude them
from invalid prototype writes while preserving quoted setters and bracketed
assignments.
@eugeniodepalo
eugeniodepalo requested a review from a team as a code owner October 15, 2026 11:57
Copilot AI max review requested due to automatic review settings October 15, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow filter preserves prototype-assignment alerts, and regression coverage checks both excluded and retained cases.

0 open findings

What changed in this PR

Fixes false positives in js/invalid-prototype-value for computed object-literal keys.

Changes:

  • Excludes computed properties while preserving alerts for prototype assignments.
  • Adds regression coverage and a release note.
File Description
javascript/​ql/​test/​query-tests/​LanguageFeatures/​InvalidPrototype/​tst.js Tests excluded and retained cases.
javascript/​ql/​test/​query-tests/​LanguageFeatures/​InvalidPrototype/​InvalidPrototype.expected Updates expected alerts.
javascript/​ql/​src/​LanguageFeatures/​InvalidPrototype.ql Filters computed object-literal properties.
javascript/​ql/​src/​change-notes/​2026-10-15-invalid-prototype-computed-property.md Documents the correction.

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants