Give every Proxy invariant violation a descriptive TypeError message#2677
Merged
Conversation
22 invariant-check sites threw bare TypeErrors with no explanation of which trap misbehaved or why. Each now carries a V8-styled message naming the trap, the property and the violated invariant, matching the tone of the handful of sites that already had rich messages. The non-callable-trap error also drops the awkward "[handler] returned for property..." phrasing for V8's "'get' trap of proxy handler is not a function". Two merged conditions (getOwnPropertyDescriptor undefined-result and defineProperty missing-property) are split so each branch can name its own violation; evaluation order is unchanged. All messages interpolate only on the throw path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE
lahma
enabled auto-merge (squash)
July 13, 2026 19:40
This was referenced Jul 15, 2026
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.
Final cleanliness piece of the Proxy series (#2674/#2675/#2676). 22 invariant-check sites threw bare TypeErrors with no hint of which trap misbehaved or why:
Every site now carries a V8-styled message naming the trap, the property, and the violated invariant — matching the tone of the handful of sites that already had rich messages (
get/set/deleteProperty). The non-callable-trap error also drops the awkward[object Object] returned for property 'get' of object ...phrasing for V8's'get' trap of proxy handler is not a function.Two merged conditions (getOwnPropertyDescriptor undefined-result, defineProperty missing-property) are split so each branch names its own violation — evaluation order unchanged. All messages interpolate only on the throw path, so hot paths are untouched (perf-flat by construction).
Verification: full Jint.Tests, PublicInterface, test262
~Proxy/~Reflectgreen (test262 never asserts messages); new exact-message assertions added to ProxyTests.🤖 Generated with Claude Code
https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE