🐛 use Function.prototype.bind instead to avoid conflict while value has own bind function (#1133)
This commit is contained in:
parent
9fd4b847cc
commit
fbbd6f1722
|
|
@ -26,7 +26,7 @@ export function getTargetValue(target: any, value: any): any {
|
||||||
return cachedBoundValue;
|
return cachedBoundValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const boundValue = value.bind(target);
|
const boundValue = Function.prototype.bind.call(value, target);
|
||||||
// some callable function has custom fields, we need to copy the enumerable props to boundValue. such as moment function.
|
// some callable function has custom fields, we need to copy the enumerable props to boundValue. such as moment function.
|
||||||
// use for..in rather than Object.keys.forEach for performance reason
|
// use for..in rather than Object.keys.forEach for performance reason
|
||||||
// eslint-disable-next-line guard-for-in,no-restricted-syntax
|
// eslint-disable-next-line guard-for-in,no-restricted-syntax
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user