fix(code-runtime): contain deep output accounting

This commit is contained in:
Tianyi Cui
2026-07-21 22:54:12 +08:00
parent 18bd8082fc
commit fc97403946
5 changed files with 107 additions and 36 deletions

View File

@@ -79,6 +79,8 @@ describe('snapshotCodeJsonValue', () => {
Object.defineProperty(symbolDecorated, Symbol('extra'), { value: true })
const hiddenObject = Object.defineProperty({}, 'hidden', { value: true })
const symbolObject = { [Symbol('extra')]: true }
const customPrototype = Object.create(null) as Record<string, unknown>
const customPrototypeObject = Object.assign(Object.create(customPrototype) as Record<string, unknown>, { value: 1 })
const forgedPrototype: unknown[] = []
Object.setPrototypeOf(forgedPrototype, null)
const forgedArray = [1]
@@ -94,6 +96,7 @@ describe('snapshotCodeJsonValue', () => {
symbolDecorated,
hiddenObject,
symbolObject,
customPrototypeObject,
forgedArray,
cyclic,
[undefined],