feat(codemode): math parity (#35609)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user