Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(sheet): mixin should not use class self (#3130)
VicKun1d7c3abc6e0b
diff --git a/packages/core/src/common/mixin.ts b/packages/core/src/common/mixin.tsindex 151b228f7b..68ac7886f8 100644--- a/packages/core/src/common/mixin.ts+++ b/packages/core/src/common/mixin.ts@@ -21,15 +21,15 @@ interface IMixinProperty<T> {/*** Mixin some methods to targetObject as prototype, the static methods will not be mixed in- * @param {T} targetClass The target class to mixin+ * @param {T} targetClassPrototype The target class to mixin* @param {IMixinProperty<T>} mixin The mixin object which contains the methods to mixin.*/-export function mixinClass<T>(targetClass: T, mixin: IMixinProperty<T>): void {+export function mixinClass<T>(targetClassPrototype: T, mixin: IMixinProperty<T>): void {for (const key in mixin) {// eslint-disable-next-line no-prototype-builtinsif (mixin.hasOwnProperty(key)) {// @ts-ignore- targetClass.prototype[key] = mixin[key];+ targetClassPrototype[key] = mixin[key];}}}