From 71ea4a2c9bf38f1ac3e6351c3f863b6698513b82 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Wed, 28 Sep 2022 00:11:15 -0700 Subject: Fix several bugs with Request body streaming + store small response bodies without an extra memory allocation --- src/bun.js/scripts/class-definitions.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (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 67e4cf475..f8b08e9bd 100644 --- a/src/bun.js/scripts/class-definitions.ts +++ b/src/bun.js/scripts/class-definitions.ts @@ -20,13 +20,23 @@ export interface ClassDefinition { proto: Record; JSType?: string; noConstructor?: boolean; + estimatedSize?: boolean; + isEventEmitter?: boolean; } export function define( - { klass = {}, proto = {}, ...rest } = {} as ClassDefinition + { + klass = {}, + proto = {}, + isEventEmitter = false, + estimatedSize = false, + ...rest + } = {} as ClassDefinition ): ClassDefinition { return { ...rest, + isEventEmitter, + estimatedSize, klass: Object.fromEntries( Object.entries(klass).sort(([a], [b]) => a.localeCompare(b)) ), -- cgit v1.2.3