Is there a UXP equivalent for eval / dynamic JavaScript execution?

We are migrating a Photoshop CEP plugin to UXP.

In our CEP implementation, we receive JavaScript/ExtendScript code as a string at runtime and execute it dynamically. The supplied script can define functions, for example:

function abc() {
    // ...
}

function xyz() {
    // ...
}

After evaluating the script, our application calls those functions.

Is there a supported equivalent in UXP for executing JavaScript code supplied as a string at runtime, similar to eval() / CEP’s dynamic script execution?

If eval() or equivalent dynamic execution is not supported in UXP, what is the Adobe-recommended approach for this use case?

The important requirement for us is that the JavaScript is supplied dynamically at runtime and is not known when the UXP plugin is packaged.