fix(Player): Fix extracting the n-token decipher algorithm (#682)

* fix(Player): Fix extracting the n-token decipher algorithm

* fix: bump Jinter to v2

---------

Co-authored-by: Luan <luan.lrt4@gmail.com>
This commit is contained in:
absidue
2024-07-10 07:21:39 +02:00
committed by GitHub
parent efa7205723
commit 142a7d0428
4 changed files with 19 additions and 11 deletions

View File

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