mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
fix: getBoundSuper() 兼容
This commit is contained in:
parent
2e508bdd73
commit
933858c1dd
@ -2,7 +2,9 @@ const {defineProperty, getPrototypeOf} = Object;
|
||||
|
||||
// 简写
|
||||
type Fn = Function
|
||||
type SuperStore = WeakMap<Fn, Fn>
|
||||
// FIXME 正确写法,但过不了检查,暂时使用 any 兼容
|
||||
// type SuperStore = WeakMap<Fn, Fn>
|
||||
type SuperStore = WeakMap<Fn, any>
|
||||
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user