aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/scripts/class-definitions.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-07 00:51:36 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-07 00:51:36 -0800
commitd925367cae1f22ad85a29ae02456286d9ccc859a (patch)
tree4ba8a0977756a5ec175716122c0ed15d48d4e0e9 /src/bun.js/scripts/class-definitions.ts
parent179cd18f70751e2d3959ec95def0f5ea697dd781 (diff)
downloadbun-d925367cae1f22ad85a29ae02456286d9ccc859a.tar.gz
bun-d925367cae1f22ad85a29ae02456286d9ccc859a.tar.zst
bun-d925367cae1f22ad85a29ae02456286d9ccc859a.zip
[bindings generator] Support cached values that do not correspond to properties and support call() functions
Diffstat (limited to 'src/bun.js/scripts/class-definitions.ts')
-rw-r--r--src/bun.js/scripts/class-definitions.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bun.js/scripts/class-definitions.ts b/src/bun.js/scripts/class-definitions.ts
index 8414cf18f..95dfd69bf 100644
--- a/src/bun.js/scripts/class-definitions.ts
+++ b/src/bun.js/scripts/class-definitions.ts
@@ -15,6 +15,7 @@ export type Field =
export interface ClassDefinition {
name: string;
construct?: boolean;
+ call?: boolean;
finalize?: boolean;
klass: Record<string, Field>;
proto: Record<string, Field>;
@@ -29,15 +30,19 @@ export function define(
{
klass = {},
proto = {},
- isEventEmitter = false,
+ values = [],
estimatedSize = false,
+ call = false,
+ construct = false,
...rest
} = {} as ClassDefinition
): ClassDefinition {
return {
...rest,
- isEventEmitter,
+ call,
+ construct,
estimatedSize,
+ values,
klass: Object.fromEntries(
Object.entries(klass).sort(([a], [b]) => a.localeCompare(b))
),