fix(code-runtime): validate arguments before worker dispatch

This commit is contained in:
Tianyi Cui
2026-07-21 18:19:07 +08:00
parent 9e01fb060e
commit 2623ddbee4
8 changed files with 194 additions and 28 deletions
@@ -33,6 +33,7 @@ export function snapshotCodeJsonValue(value: unknown): CodeJsonValue | undefined
if (Array.isArray(candidate)) {
if (Object.getPrototypeOf(candidate) !== Array.prototype) return undefined
if (Reflect.ownKeys(candidate).length !== candidate.length + 1) return undefined
return within(candidate, () => {
const result: CodeJsonValue[] = []
for (let index = 0; index < candidate.length; index++) {