fix(reflect): receiver-aware get, apply thisArg, construct newTarget, has chain, ownKeys symbols, setPrototypeOf failure#3499
Merged
Conversation
added 2 commits
May 31, 2026 03:13
…ymbols, setPrototypeOf failure Implement Node-compatible non-proxy semantics for six Reflect operations: - #2766 Reflect.get(target, key, receiver): carry the optional receiver through HIR/codegen/runtime; rebind an accessor getter's this to the receiver (via clone_closure_rebind_this) and throw TypeError on a non-object target. - #2767 Reflect.apply(fn, thisArg, argumentsList): bind thisArg, implement CreateListFromArrayLike (array-like objects, not just Arrays), throw TypeError for a non-callable target or a non-object argumentsList. - #2764 Reflect.has(target, key): full [[HasProperty]] including the prototype chain (probe via the inherited field read), throw TypeError on a non-object target, ToBoolean-normalize proxy trap results. - #2763 Reflect.ownKeys(target): include own symbol keys after string names, throw TypeError on a non-object target. - #2761 Reflect.setPrototypeOf(target, proto): return a boolean (false when a non-extensible target rejects a changing prototype), throw TypeError for a non-object target or a proto that is neither object nor null. Proxy three-argument get traps, ownKeys traps, setPrototypeOf traps, and the full Reflect.construct newTarget path (#2768) are out of scope and dropped (Perry lacks those trap dispatches / a runtime construct-from-value path). Adds Expr::ReflectSetPrototypeOf (stable-hash tag 12230) and a receiver field on Expr::ReflectGet. Retention anchors added for the codegen-only reflect entry points.
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.
Implements correct Node non-proxy semantics for six Reflect operations. Each behavior is asserted byte-for-byte against node --experimental-strip-types in test-files/test_gap_reflect_semantics2.ts under the default auto-optimize compile.
Closes #2766
Closes #2767
Closes #2764
Closes #2763
Closes #2761
Implementation
Dropped
Validation
HIR