GeezerVison is showing github.com — Clarify Proxy invariants and trap return values by tagbug · Pull Request #3994 · javascript-tutorial/en.javascript.info
Conversation
Summary
This PR clarifies the wording around Proxy invariants while keeping the existing beginner-friendly explanation.
The current invariants note mixes two related concepts:
- the normal meaning of internal-method return values, such as
[[Set]] returning true for success and false for failure;
- restrictions that JavaScript actually enforces as invariants on Proxy behavior.
The change keeps the former as recommended trap behavior (should) and distinguishes it from the latter.
It also fixes two related details:
[[GetPrototypeOf]] only has to return the target's actual prototype when the target is non-extensible (and its result must always be an object or null);
- a falsy
set result reports that the write failed. Whether this becomes a TypeError depends on the operation using [[Set]]; the push example in this section is such an operation.
No examples or overall structure are changed.
References
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
CLAassistant
commented
Sep 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
All committers have signed the CLA.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 Approval recommended
The changes are documentation-only clarifications that align the article’s statements with Proxy invariant rules and internal-method return semantics without altering examples or introducing inconsistencies.
Pull request overview
This PR refines the “Proxy invariants” explanation in the Proxy article by clearly separating (1) the usual meaning of internal-method return values (recommended trap behavior) from (2) the actual invariants that JavaScript enforces on Proxy traps.
Changes:
- Rewords the “Invariants” warning to distinguish return-value semantics (“should”) from enforced invariants.
- Corrects the
[[GetPrototypeOf]] invariant description (object-or-null result; equality requirement only when the target is non-extensible).
- Clarifies that a falsy
set trap result reports failure and only certain operations (e.g. push) necessarily throw TypeError.
File summaries
| File |
Description |
| 1-js/99-js-misc/01-proxy/article.md |
Clarifies Proxy invariant wording and updates getPrototypeOf/set return-value explanations without changing examples/structure. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.