diff --git a/packages/code-runtime/code-runtime-worker/tests/worker-json.spec.ts b/packages/code-runtime/code-runtime-worker/tests/worker-json.spec.ts index d745c68978..e0c8310a6a 100644 --- a/packages/code-runtime/code-runtime-worker/tests/worker-json.spec.ts +++ b/packages/code-runtime/code-runtime-worker/tests/worker-json.spec.ts @@ -103,6 +103,13 @@ describe('snapshotCodeJsonValue', () => { Object.defineProperty(spoofedObjectPrototype, 'constructor', { value: SpoofedObject }) const spoofedObject = Object.create(spoofedObjectPrototype) as Record spoofedObject.value = 1 + const revokedPrototype = Object.create(null) as Record + const RevokedObject = function Object() {} + RevokedObject.prototype = revokedPrototype + const revokedConstructor = Proxy.revocable(RevokedObject, {}) + Object.defineProperty(revokedPrototype, 'constructor', { value: revokedConstructor.proxy }) + const revokedObject = Object.create(revokedPrototype) as Record + revokedConstructor.revoke() const spoofedArrayPrototype: unknown[] = [] Object.setPrototypeOf(spoofedArrayPrototype, Object.prototype) const SpoofedArray = function Array() {} @@ -124,6 +131,7 @@ describe('snapshotCodeJsonValue', () => { customPrototypeObject, forgedArray, spoofedObject, + revokedObject, spoofedArray, cyclic, [undefined],