Basically, yes. In practice, there's a bit more to it. The user code is wrapped into an "async function(input)" (so you can use async/await) and run inside a worker inside a sandboxed iframe (for security reasons and for being able to stop the execution). There's also some additional code for catching errors and parsing the error stack.