src/engine/inject/references.js
function injectReferences (funcs, task) {
  /**
   * Inject task.
   *
   * @param {String} taskKey
   */

  function inject (taskKey) {
    var referenceName = null
    var referencedFunction = null
    var taskName = task[taskKey]

    /**
     * Inject reference.
     */

    function reference () {
      return referencedFunction
    }

    if (regexReference.test(taskName)) {
      referenceName = taskName.substring(1)

      if (typeof funcs[referenceName] === 'function') {
        referencedFunction = funcs[referenceName]
      } else {
        referencedFunction = walkGlobal(referenceName)
      }

      if (typeof referencedFunction === 'function') {
        funcs[taskName] = reference
      }
    }
  }

  Object.keys(task).forEach(inject)
}
function injectReferences (funcs, task) {
  /**
   * Inject task.
   *
   * @param {String} taskKey
   */

  function inject (taskKey) {
    var referenceName = null
    var referencedFunction = null
    var taskName = task[taskKey]

    /**
     * Inject reference.
     */

    function reference () {
      return referencedFunction
    }

    if (regexReference.test(taskName)) {
      referenceName = taskName.substring(1)

      if (typeof funcs[referenceName] === 'function') {
        referencedFunction = funcs[referenceName]
      } else {
        referencedFunction = walkGlobal(referenceName)
      }

      if (typeof referencedFunction === 'function') {
        funcs[taskName] = reference
      }
    }
  }

  Object.keys(task).forEach(inject)
}
function injectReferences ( funcs , task ) { /**
   * Inject task.
   *
   * @param {String} taskKey
   */ function inject ( taskKey ) { var referenceName = null var referencedFunction = null var taskName = task [ taskKey ] /**
     * Inject reference.
     */ function reference ( ) { return referencedFunction } if ( regexReference . test ( taskName ) ) { referenceName = taskName . substring ( 1 ) if ( typeof funcs [ referenceName ] === 'function' ) { referencedFunction = funcs [ referenceName ] } else { referencedFunction = walkGlobal ( referenceName ) } if ( typeof referencedFunction === 'function' ) { funcs [ taskName ] = reference } } } Object . keys ( task ) . forEach ( inject ) }
Inject references to functions.

@param {Object} funcs reference
@param {Object} task
Inject references to functions .