From c39c11e1011b682c2c4e48594c7d6110cfc3343c Mon Sep 17 00:00:00 2001 From: Dylan Conway <35280289+dylan-conway@users.noreply.github.com> Date: Fri, 14 Jul 2023 19:37:22 -0700 Subject: structured clone (#3637) * copy `SerializedScriptValue` * format * make `SerializedScriptValue` compile * add `transfer` option * tests * serialize/deserialize blobs * tests for blobs * serialize/deserialize file blobs * more tests * small cleanup * format * small changes + serialize offset * slice helper * map and set test --- src/bun.js/scripts/class-definitions.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/bun.js/scripts/class-definitions.ts') diff --git a/src/bun.js/scripts/class-definitions.ts b/src/bun.js/scripts/class-definitions.ts index 59b8f6f05..281cd62c5 100644 --- a/src/bun.js/scripts/class-definitions.ts +++ b/src/bun.js/scripts/class-definitions.ts @@ -41,6 +41,7 @@ export interface ClassDefinition { configurable?: boolean; enumerable?: boolean; + structuredClone?: boolean | { transferrable: boolean; tag: number }; } export interface CustomField { @@ -58,6 +59,7 @@ export function define( estimatedSize = false, call = false, construct = false, + structuredClone = false, ...rest } = {} as ClassDefinition, ): ClassDefinition { @@ -66,6 +68,7 @@ export function define( call, construct, estimatedSize, + structuredClone, values, klass: Object.fromEntries(Object.entries(klass).sort(([a], [b]) => a.localeCompare(b))), proto: Object.fromEntries(Object.entries(proto).sort(([a], [b]) => a.localeCompare(b))), -- cgit v1.2.3