lib/run_function.js
function runSync(context, func, callback)
{
  var result
    , requiresContext = isArrowFunction(func)
    ;

  try
  {
    if (requiresContext)
    {
      result = func.call(null, context);
    }
    else
    {
      result = func.call(context);
    }
  }
  catch (ex)
  {
    // pass error as error-first callback
    callback(ex);
    return;
  }

  // everything went well
  callback(null, result);
}
function runSync(context, func, callback)
{
  var result
    , requiresContext = isArrowFunction(func)
    ;

  try
  {
    if (requiresContext)
    {
      result = func.call(null, context);
    }
    else
    {
      result = func.call(context);
    }
  }
  catch (ex)
  {
    // pass error as error-first callback
    callback(ex);
    return;
  }

  // everything went well
  callback(null, result);
}
function runSync ( context , func , callback ) { var result , requiresContext = isArrowFunction ( func ) ; try { if ( requiresContext ) { result = func . call ( null , context ) ; } else { result = func . call ( context ) ; } } catch ( ex ) { // pass error as error-first callback callback ( ex ) ; return ; } // everything went well callback ( null , result ) ; }
Wraps synchronous function with common interface

@param   {object} context - context to invoke within
@param   {function} func - function to execute
@param   {Function} callback - invoke after function is finished executing
@returns {void}
Wraps synchronous function with common interface