diff --git a/packages/amis-core/src/utils/autobind.ts b/packages/amis-core/src/utils/autobind.ts index 1fa6397fb..eb3aa3f33 100644 --- a/packages/amis-core/src/utils/autobind.ts +++ b/packages/amis-core/src/utils/autobind.ts @@ -2,7 +2,9 @@ const {defineProperty, getPrototypeOf} = Object; // 简写 type Fn = Function -type SuperStore = WeakMap +// FIXME 正确写法,但过不了检查,暂时使用 any 兼容 +// type SuperStore = WeakMap +type SuperStore = WeakMap export function bind(fn: Fn, thisArg: any): Fn { if (fn.bind) { @@ -37,7 +39,7 @@ function getBoundSuper(obj: Object, fn: Fn) { superStore.set(fn, bind(fn, obj)); } - return superStore.get(fn) as Fn; + return superStore.get(fn); } function createDefaultSetter(key: string) {