mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: declared properties
This commit is contained in:
parent
272ddac08b
commit
7e9aa6769e
@ -49,10 +49,15 @@ export function Mixin<T, C extends TypeClass[]>(...args: C): C[number] & T {
|
||||
super(...constructorArgs);
|
||||
|
||||
for (const mixin of args.slice(1)) {
|
||||
const descriptors = getDescriptors(mixin).reverse();
|
||||
// @ts-expect-error
|
||||
Object.assign(this, new mixin(...constructorArgs));
|
||||
const descriptors = getDescriptors(mixin).reverse().concat(Object.getOwnPropertyDescriptors(mixin));
|
||||
for (const desc of descriptors) {
|
||||
for (const key in desc) {
|
||||
if (key === 'constructor') continue;
|
||||
if (key === 'constructor') {
|
||||
Object.assign(this, new desc[key].value(...constructorArgs));
|
||||
continue;
|
||||
}
|
||||
if (key in MixedClass.prototype) continue;
|
||||
const descriptor = desc[key];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user