mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
tweaks to generator
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
interface PropertyAttribute {
|
||||
enumerable?: boolean;
|
||||
configurable?: boolean;
|
||||
}
|
||||
|
||||
export type Field =
|
||||
| { getter: string; cache?: true | string; this?: boolean }
|
||||
| { setter: string; this?: boolean }
|
||||
| {
|
||||
| ({ getter: string; cache?: true | string; this?: boolean } & PropertyAttribute)
|
||||
| ({ setter: string; this?: boolean } & PropertyAttribute)
|
||||
| ({
|
||||
accessor: { getter: string; setter: string };
|
||||
cache?: true | string;
|
||||
this?: boolean;
|
||||
}
|
||||
| {
|
||||
} & PropertyAttribute)
|
||||
| ({
|
||||
fn: string;
|
||||
length?: number;
|
||||
DOMJIT?: {
|
||||
returns: string;
|
||||
args?: [string, string] | [string, string, string] | [string];
|
||||
};
|
||||
}
|
||||
} & PropertyAttribute)
|
||||
| { internal: true };
|
||||
|
||||
export interface ClassDefinition {
|
||||
@@ -31,6 +36,9 @@ export interface ClassDefinition {
|
||||
isEventEmitter?: boolean;
|
||||
|
||||
custom?: Record<string, CustomField>;
|
||||
|
||||
configurable?: boolean;
|
||||
enumerable?: boolean;
|
||||
}
|
||||
|
||||
export interface CustomField {
|
||||
@@ -57,11 +65,7 @@ export function define(
|
||||
construct,
|
||||
estimatedSize,
|
||||
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)),
|
||||
),
|
||||
klass: Object.fromEntries(Object.entries(klass).sort(([a], [b]) => a.localeCompare(b))),
|
||||
proto: Object.fromEntries(Object.entries(proto).sort(([a], [b]) => a.localeCompare(b))),
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user