fix: remove function bind

If the returned function is bound to a context, there is no way to call it with `call` and `apply`.
This commit is contained in:
Rainke 2023-07-18 10:37:46 +08:00 committed by GitHub
parent ce7e766b86
commit fc947d2feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;