You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON.parse of an object with more than 10,000 keys: computed-key reads return undefined and Object.entries values are null #10175
JSON.parse of an object with more than 10,000 keys produces an object whose values can't be read. Object.keys, in, hasOwnProperty and literal-key reads (v["k5"]) work. Computed-key reads (v["k" + i]) return undefined, and Object.entries(v) gives null for every value. Objects built by assignment (o["k" + i] = i) are unaffected.
Found on main (9b911855f8) during a merge-train audit; it is unrelated to the PR under audit (#10168), which behaves identically.
Bisected in-process: 10,000 keys are correct, 10,001 keys are broken (127,796 bytes of source). Values are irrelevant: the same happens with nested record values, e.g. a 60,000-key object of {"id","name","tags","score","active"} records reads v["k" + r] as undefined.
// Guard: corrupted objects with unreasonably large field_countif live > 10000{returnJSValue::undefined();}
The JSON object builder keeps every field inline, so a parsed object with more than 10,000 fields has live > 10000. Every indexed read of it then returns undefined, whatever the field index. Assignment-built objects spill fields past their inline capacity into the overflow map (the field_index >= live branch above the guard), so they never reach it. Literal-key reads take a different lookup path, which is why v["k5"] still works.
The guard dates from a corruption-detection era. Either it should bound only the index actually being read against the object's allocated slot capacity, or the parse builders should respect the same inline cap that assignment does.
Activity
proggeramlug commentedon Sep 14, 2026
Fixed by merge train 185r (#10242) at 9fda98d.