Files
workinf_Blender_Wasm/web/app/src/testing/script-sandbox-dispose.ts
mes123456 380cbed4ff
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
Checkpoint web parity through Chromium input tasks
2026-08-19 10:39:03 -04:00

28 lines
918 B
TypeScript

export const SCRIPT_SANDBOX_DISPOSE_SCHEMA = 1 as const;
export interface ScriptSandboxDisposeReceipt {
schemaVersion: typeof SCRIPT_SANDBOX_DISPOSE_SCHEMA;
disposeCount: number;
idempotent: boolean;
resources: {
messagePorts: 0;
timers: 0;
abortControllers: 0;
transferableBuffers: 0;
pendingRequests: 0;
cacheReferences: 0;
};
lateTimerMessages: 0;
}
export function createScriptSandboxDisposeReceipt(disposeCount: number): ScriptSandboxDisposeReceipt {
if (!Number.isSafeInteger(disposeCount) || disposeCount < 1) throw new Error("SCRIPT_SANDBOX_DISPOSE_INVALID: dispose count must be positive");
return {
schemaVersion: SCRIPT_SANDBOX_DISPOSE_SCHEMA,
disposeCount,
idempotent: disposeCount > 1,
resources: { messagePorts: 0, timers: 0, abortControllers: 0, transferableBuffers: 0, pendingRequests: 0, cacheReferences: 0 },
lateTimerMessages: 0,
};
}