Skip to content

Commit

Permalink
fix: upgrade scope-eval to properly support function scope
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Aug 20, 2021
1 parent 84032ee commit 52a2a58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
4 changes: 2 additions & 2 deletions src/value-evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand All @@ -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}`);
}
Expand Down

0 comments on commit 52a2a58

Please sign in to comment.