Perry: origin/main @ a1d9ce6 (v0.5.1174) · macOS arm64
Build/run: perry repro.ts -o out && ./out
Bug
Array.prototype.map (and likely other Array methods) called on a Proxy-wrapped array throws TypeError: Cannot convert undefined or null to object. Individual proxy traps work; the array-method-on-proxy path does not.
Surfaced after #5129 (the Proxy set/Reflect.set segfault fix) — the fuller proxy case now gets past the set trap and dies here instead.
Repro
const arr = new Proxy([1, 2, 3] as number[], { get(t, k, r) { return Reflect.get(t, k, r); } });
console.log(arr.map((x) => x * 10).join(","));
Expected (Node)
Actual (Perry)
TypeError: Cannot convert undefined or null to object
Perry:
origin/main@ a1d9ce6 (v0.5.1174) · macOS arm64Build/run:
perry repro.ts -o out && ./outBug
Array.prototype.map(and likely other Array methods) called on a Proxy-wrapped array throwsTypeError: Cannot convert undefined or null to object. Individual proxy traps work; the array-method-on-proxy path does not.Surfaced after #5129 (the Proxy
set/Reflect.setsegfault fix) — the fuller proxy case now gets past the set trap and dies here instead.Repro
Expected (Node)
Actual (Perry)