GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Clarify Proxy invariants and trap return values by tagbug · Pull Request #3994 · javascript-tutorial/en.javascript.info

Conversation

@tagbug

@tagbug tagbug commented Sep 8, 2026

Copy link
Copy Markdown

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

  • ECMA-262 §6.1.7.2 — Object Internal Methods and Internal Slots
  • ECMA-262 §6.1.7.3 — Invariants of the Essential Internal Methods
  • ECMA-262 §10.5 — Proxy Object Internal Methods and Internal Slots
  • MDN — handler.set()
  • MDN — handler.getPrototypeOf()

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tagbug
Clarify Proxy invariants and trap return values
0d8bbaa
Copilot AI lite review requested due to automatic review settings September 8, 2026 19:50
@javascript-translate-bot javascript-translate-bot added the review needed Review needed, please approve or request changes label Sep 8, 2026
@javascript-translate-bot
javascript-translate-bot requested review from a team September 8, 2026 19:50
@CLAassistant

CLAassistant commented Sep 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started reviewing on behalf of tagbug September 8, 2026 19:51
View session
Copilot AI reviewed Sep 8, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

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

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

review needed Review needed, please approve or request changes

Projects

None yet

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.

4 participants

@tagbug @CLAassistant @javascript-translate-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.