Repository navigation
JS: Do not flag computed __proto__ properties - #22829
Open
eugeniodepalo wants to merge 1 commit into
Open
eugeniodepalo wants to merge 1 commit into
eugeniodepalo wants to merge 1 commit into
Conversation
Computed object-literal keys define ordinary data properties. Exclude them from invalid prototype writes while preserving quoted setters and bracketed assignments.
Contributor
There was a problem hiding this comment.
🟢 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
js/invalid-prototype-valuereports{ ["__proto__"]: 9 }, although a computed object-literal key creates an ordinary data property.Exclude computed object-literal writes while retaining alerts for
{ "__proto__": 42 }andobject["__proto__"] = 42.Observed in gtkx-org/gtkx#658.
Validation: focused regression test, query formatting, and change-note release validation.