diff --git a/src/sandbox/common.ts b/src/sandbox/common.ts index 1388923..65475d5 100644 --- a/src/sandbox/common.ts +++ b/src/sandbox/common.ts @@ -26,7 +26,7 @@ export function getTargetValue(target: any, value: any): any { 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. // use for..in rather than Object.keys.forEach for performance reason // eslint-disable-next-line guard-for-in,no-restricted-syntax