src/eval.js
function _createScript(config, options, scope={}) {
  if (!isString(config.content)) return config.content;
  const stringScript = wrap(config.content.replace(/^\#\!.*/, ''), scope);
  try {
    return new vm.Script(stringScript, options);
  } catch(error) { // These are not squashed as not evaluation errors but something else.
    if (_runError(error, module)) throw error;
  }
}
function _createScript(config, options, scope={}) {
  if (!isString(config.content)) return config.content;
  const stringScript = wrap(config.content.replace(/^\#\!.*/, ''), scope);
  try {
    return new vm.Script(stringScript, options);
  } catch(error) { // These are not squashed as not evaluation errors but something else.
    if (_runError(error, module)) throw error;
  }
}
function _createScript ( config , options , scope = { } ) { if ( ! isString ( config . content ) ) return config . content ; const stringScript = wrap ( config . content . replace ( / ^\#\!.* / , '' ) , scope ) ; try { return new vm . Script ( stringScript , options ) ; } catch ( error ) { // These are not squashed as not evaluation errors but something else. if ( _runError ( error , module ) ) throw error ; } }
Given a config and some options create a script ready for vm sandboxing.

@param {Object} config       Config for this operation.
@param {options} options     Options for the script.
@returns {VMScript}          New script ready to use.
Given a config and some options create a script ready for vm sandboxing .