From fc947d2feb0411223430ab154398cfcd83c11dcb Mon Sep 17 00:00:00 2001 From: Rainke Date: Tue, 18 Jul 2023 10:37:46 +0800 Subject: [PATCH] fix: remove function bind If the returned function is bound to a context, there is no way to call it with `call` and `apply`. --- packages/renderer-core/src/utils/common.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/renderer-core/src/utils/common.ts b/packages/renderer-core/src/utils/common.ts index 262231eef..3439bf297 100644 --- a/packages/renderer-core/src/utils/common.ts +++ b/packages/renderer-core/src/utils/common.ts @@ -264,8 +264,7 @@ function parseExpression(a: any, b?: any, c = false) { if (!thisRequired) { code = `with($scope){${code}}`; } - const result = new Function('$scope', code)(self); - return typeof result === "function" ? result.bind(self): result; + return new Function('$scope', code)(self); } catch (err) { logger.error(`${logScope || ''} parseExpression.error`, err, str, self?.__self ?? self); return undefined;