diff --git a/package.json b/package.json index b0f37a1..cd07a9a 100644 --- a/package.json +++ b/package.json @@ -16,15 +16,15 @@ "license": "MIT", "author": "Chunpeng Huo", "devDependencies": { - "@babel/core": "^7.14.8", - "@babel/preset-env": "^7.14.8", - "@babel/register": "^7.14.5", + "@babel/core": "^7.15.0", + "@babel/preset-env": "^7.15.0", + "@babel/register": "^7.15.3", "@babel/cli": "^7.14.8", - "@vercel/ncc": "^0.29.0", + "@vercel/ncc": "^0.29.2", "babel-eslint": "^10.1.0", - "eslint": "^7.31.0", + "eslint": "^7.32.0", "standard-changelog": "^2.0.27", - "tape": "^5.2.2" + "tape": "^5.3.1" }, "scripts": { "prebuild": "ncc build src/index.js -m -e contextual-proxy -e scoped-eval -e lodash -o packed", @@ -44,8 +44,8 @@ "index.d.ts" ], "dependencies": { - "contextual-proxy": "^0.2.0", + "contextual-proxy": "^0.2.2", "lodash": "^4.17.21", - "scoped-eval": "^0.3.0" + "scoped-eval": "^0.4.0" } } diff --git a/src/value-evaluator.js b/src/value-evaluator.js index b2015bf..f9caf32 100644 --- a/src/value-evaluator.js +++ b/src/value-evaluator.js @@ -22,7 +22,7 @@ export default function (input, stringInterpolation) { const func = build(input, stringInterpolation); return scope => { try { - return func.call(scope); + return func(scope); } catch (e) { throw new Error(`Failed to execute expression: ${JSON.stringify(input)}\n${e.message}`); } @@ -45,7 +45,7 @@ export default function (input, stringInterpolation) { const get = expression => { const func = build(expression); try { - return func.call(scope); + return func(scope); } catch (e) { throw new Error(`Failed to execute expression: ${JSON.stringify(input)}\n${e.message}`); }