function runScript(code, globals = defaultGlobals()) {
  if (typeof code !== 'string' || code === '') {
    throw new Error('runScript requires a bundle string as the first argument')
  }
  const context = createContext(globals)
  context.self = context // minimal browser emulation
  return {
    context,
    result: runInNewContext(code, context),
  }
}
Run a script in a new context, without SES

@param {string} code
@param {Record<string, any>} globals
@returns {any}