feat(codemode): math parity (#35609)
This commit is contained in:
parent
df471872de
commit
ba24037e64
6 changed files with 172 additions and 18 deletions
|
|
@ -274,6 +274,16 @@ const copyBounded = (
|
|||
|
||||
if (Array.isArray(value)) {
|
||||
const copied = value.map((item) => copyBounded(item, label, depth + 1, seen, preserveSandboxValues))
|
||||
if (preserveSandboxValues) {
|
||||
// Array metadata is not serialized, but intra-sandbox copies must retain it.
|
||||
for (const [key, item] of Object.entries(value)) {
|
||||
if (Object.hasOwn(copied, key)) continue
|
||||
if (isBlockedMember(key)) {
|
||||
throw new ToolRuntimeError("InvalidDataValue", `${label} contains blocked property '${key}'.`)
|
||||
}
|
||||
Reflect.set(copied, key, copyBounded(item, label, depth + 1, seen, true))
|
||||
}
|
||||
}
|
||||
seen.delete(value)
|
||||
return copied
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue