const {...rest} = obj silently drops Symbol-keyed own properties from rest instead of copying them through.
const s = Symbol("k");
const obj = { a: 1, [s]: 2 };
const { ...rest } = obj;
console.log(Object.getOwnPropertySymbols(rest).length); // node: 1, perry: 0
console.log(rest[s]); // node: 2, perry: undefined
Per spec, object rest performs CopyDataProperties, which iterates OwnPropertyKeys — that includes Symbol keys, and excludes only the pattern's named keys and non-enumerable properties. Symbol-keyed own enumerable properties must be copied.
Reproduces on an unmodified base binary, so it predates and is unrelated to #10814 (which only changes how the excluded-key array is built in codegen). The behaviour lives in js_object_rest's key-copy logic, crates/perry-runtime/src/object/delete_rest.rs.
Found while writing the gap test for #10814. That test deliberately scopes this case out with an explanatory comment rather than asserting the wrong output, so the coverage gap is visible in the source rather than silently baked in — worth removing that scope-out as the fix's regression test.
const {...rest} = objsilently drops Symbol-keyed own properties fromrestinstead of copying them through.Per spec, object rest performs
CopyDataProperties, which iteratesOwnPropertyKeys— that includes Symbol keys, and excludes only the pattern's named keys and non-enumerable properties. Symbol-keyed own enumerable properties must be copied.Reproduces on an unmodified base binary, so it predates and is unrelated to #10814 (which only changes how the excluded-key array is built in codegen). The behaviour lives in
js_object_rest's key-copy logic,crates/perry-runtime/src/object/delete_rest.rs.Found while writing the gap test for #10814. That test deliberately scopes this case out with an explanatory comment rather than asserting the wrong output, so the coverage gap is visible in the source rather than silently baked in — worth removing that scope-out as the fix's regression test.