jsonata-js/jsonata

`__evaluate_entry` and `__evaluate_exit` can be overridden inside expression

adamscybot opened this issue · 0 comments

These "secret" environment callbacks are regularly used to timebox expressions or detect loops. You can disable such protections by assigning them to a falsey value inside the expression itself.

These bindings should probably be non-writeable (possibly non-readable also?) from inside the expression:

const expression = jsonata(`
 (
    $__evaluate_entry := false;
    $__evaluate_exit := false;
    /* Anything here, like a loop, will not be captured by the entry and exit callbacks */
  )
`)

await expression.evaluate()