Skip to content

Commit

Permalink
fix: bump Jinter to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Jul 10, 2024
1 parent c01b901 commit 8bcfdea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
},
"license": "MIT",
"dependencies": {
"jintr": "^1.1.0",
"jintr": "^2.0.0",
"tslib": "^2.5.0",
"undici": "^5.19.1"
},
Expand Down
4 changes: 2 additions & 2 deletions src/platform/jsruntime/jinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const TAG = 'JsRuntime';
export default function evaluate(code: string, env: Record<string, VMPrimative>) {
Log.debug(TAG, 'Evaluating JavaScript:\n', code);

const runtime = new Jinter(code);
const runtime = new Jinter();

for (const [ key, value ] of Object.entries(env)) {
runtime.scope.set(key, value);
}

const result = runtime.interpret();
const result = runtime.evaluate(code);

Log.debug(TAG, 'Done. Result:', result);

Expand Down

0 comments on commit 8bcfdea

Please sign in to comment.