Fixes issues with global.

This commit is contained in:
Henning Dieterichs
2021-06-22 09:59:50 +02:00
parent 683f1e1f76
commit cd88168211
15 changed files with 281 additions and 240 deletions

View File

@@ -12,8 +12,8 @@ export function cache<T>(
let resultFn: () => any;
let key: string;
if (typeof expression === "string") {
const evalFn = DataExtractorApiImpl.lastEvalFn!;
resultFn = () => evalFn(expression);
const context = DataExtractorApiImpl.lastContext!;
resultFn = () => context.evalFn(expression);
key = JSON.stringify({ expr: expression, id });
} else {
resultFn = () => expression();