Fixes issues with global.
This commit is contained in:
@@ -2,12 +2,22 @@ import { DataExtractorApiImpl } from "../api";
|
||||
|
||||
export function find(predicate: (obj: unknown) => boolean): unknown {
|
||||
const processed = new Set();
|
||||
if (!DataExtractorApiImpl.lastVariablesInScope) {
|
||||
throw new Error("No variables in scope!");
|
||||
if (!DataExtractorApiImpl.lastContext) {
|
||||
throw new Error("No data extractor context!");
|
||||
}
|
||||
|
||||
const values = Object.values(DataExtractorApiImpl.lastVariablesInScope);
|
||||
const queue = [...values];
|
||||
const values = Object.values(
|
||||
DataExtractorApiImpl.lastContext.variablesInScope
|
||||
);
|
||||
const queue = [
|
||||
...values.map((v) => {
|
||||
try {
|
||||
return v();
|
||||
} catch (e) {
|
||||
return undefined;
|
||||
}
|
||||
}),
|
||||
];
|
||||
|
||||
let i = 10000;
|
||||
while (i > 0) {
|
||||
|
||||
Reference in New Issue
Block a user