Can I use `eval` or similar functions?


No. eval and similar methods of executing code are disabled. This is for a variety of reasons, including security-related concerns.

This doesn’t, however, prevent you from running arbitrary code – it just means you have to get inventive. Before considering this path, however, be sure to consider whether or not you really need to run arbitrary code, as there may be considerable risks to doing so.

Some options:

Cannot create a JavaScript "Function" object

From my test and understanding, a JS interpreter like (that you mentioned) resorts to the Function type, which is also forbidden in the Adobe XD plugin runtime.

Did I miss something? Is it really possible to interpret JavaScript code within JavaScript without using the eval or Function?


sval works for sure; I’ve used it myself.