Skip to content

Commit 6f34089

Browse files
committed
checkpoint
1 parent 522dc02 commit 6f34089

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

src/loader/merge.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@ export const mergeFormats = (formats: Format[]): Format => {
4747
return formats.some((f) => key in (f as object));
4848
},
4949

50-
ownKeys(_target) {
50+
ownKeys() {
5151
const keys = new Set<string>();
52+
5253
for (const format of formats) {
53-
for (const key in format) keys.add(key);
54+
for (const key in format) {
55+
keys.add(key);
56+
}
5457
}
58+
5559
return [...keys];
5660
},
5761

@@ -64,8 +68,7 @@ export const mergeFormats = (formats: Format[]): Format => {
6468
};
6569

6670
// Each call gets a fresh subclass so its prototype slot is independent.
67-
const MergedFormat = class extends NullProxy {};
68-
return MergedFormat.from(handler) as unknown as Format;
71+
return NullProxy.from(handler) as unknown as Format;
6972
};
7073

7174
// ─── NullProxy ────────────────────────────────────────────────────────────────
@@ -84,9 +87,10 @@ class NullProxy {
8487
}
8588

8689
static from(handler: ProxyHandler<object>): NullProxy {
87-
const proxy = new Proxy(Object.create(null) as object, handler);
88-
Object.setPrototypeOf(this.prototype as object, proxy);
89-
return Reflect.construct(this, []) as NullProxy;
90+
return new Proxy(Object.create(null) as object, handler);
91+
// Object.setPrototypeOf(this.prototype, new Proxy(Object.create(null) as object, handler));
92+
93+
// return new this;
9094
}
9195
}
9296

0 commit comments

Comments
 (0)