Fix Proxy construct trap receiving Array-constructor-mangled arguments#2670
Merged
Conversation
lahma
enabled auto-merge (squash)
July 13, 2026 12:55
lahma
force-pushed
the
proxy-construct-args
branch
from
July 13, 2026 14:18
bc5088d to
44b3f37
Compare
The [[Construct]] internal method built the trap's argumentsList via the Array constructor, so a single numeric argument hit Array(length) semantics: `new proxy(42)` handed the construct trap an empty array with length 42 instead of [42], and `new proxy(1.5)` threw a spurious RangeError (invalid array length). Per spec step 7 (https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget) the list must be created with CreateArrayFromList; use ConstructFast like the [[Call]]/apply path already does. test262 misses this because built-ins/Proxy/construct/call-parameters.js constructs with two arguments. V8 (node 24) confirms the fixed behavior: new p(42) -> args [42], new p(1.5) -> args [1.5]. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE
lahma
force-pushed
the
proxy-construct-args
branch
from
July 13, 2026 14:30
44b3f37 to
1a5cc53
Compare
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.
JsProxy.[[Construct]]built the trap'sargumentsListwithArray.Construct, i.e. JSArray(...)constructor semantics. A single numeric argument therefore hit theArray(length)path:Per spec step 7 the list must be created with CreateArrayFromList — now uses
ConstructFast, the same helper the[[Call]]/apply path already uses.test262 misses this because
built-ins/Proxy/construct/call-parameters.jsconstructs with two arguments. Cross-checked against node 24 / V8.🤖 Generated with Claude Code
https://claude.ai/code/session_01EsHuKuE4UihKZp5HYapDHE