From 7e9aa6769e2ec1a3a8622d291ffebaa3581f1a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Susa=C3=B1a?= Date: Mon, 24 Feb 2025 03:07:18 -0400 Subject: [PATCH] fix: declared properties --- src/deps/mixer.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/deps/mixer.ts b/src/deps/mixer.ts index 4995fc9..2d9f5a4 100644 --- a/src/deps/mixer.ts +++ b/src/deps/mixer.ts @@ -49,10 +49,15 @@ export function Mixin(...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];