code: function load_plugin(plugin_desc, start_module, eraro) {
    var current_module = start_module
    var builtin = true
    var level = 0
    var reqfunc
    var funcdesc = {}
  
    // Each loop ascends the module.parent hierarchy
    while (
      null == funcdesc.initfunc &&
      (reqfunc = make_reqfunc(current_module))
    ) {
      funcdesc = perform_require(reqfunc, plugin_desc, builtin, level)
  
      if (funcdesc.error)
        throw handle_load_error(
          funcdesc.error,
          funcdesc.found,
          plugin_desc,
          eraro
        )
  
      builtin = false
      level++
      current_module = current_module.parent
    }
  
    // Record the details of where we found the plugin.
    // This is useful for debugging, especially if the "wrong" plugin is loaded.
    plugin_desc.modulepath = funcdesc.module
    plugin_desc.requirepath = funcdesc.require
    plugin_desc.found = funcdesc.found
  
    // The function name of the initfunc, if defined,
    // sets the final name of the plugin.
    // This replaces relative path references (like "../myplugins/foo")
    // with a clean name ("foo").
    if (
      funcdesc.initfunc &&
      null != funcdesc.initfunc.name &&
      '' !== funcdesc.initfunc.name
    ) {
      plugin_desc.name = funcdesc.initfunc.name
    }
  
    plugin_desc.init = funcdesc.initfunc
  
    // Init function can also provide options
    if (plugin_desc.init && 'object' === typeof plugin_desc.init.defaults) {
      plugin_desc.defaults = Object.assign({}, plugin_desc.init.defaults)
    }
  }
docs: #### Attempt to load the plugin The following algorithm is used: 0. WHILE module defined 1.   FOR EACH search-entry 2.     IF NOT first module IGNORE builtins 3.     PERFORM require ON search-entry.name 4.     IF FOUND BREAK 5.     IF ERROR THROW # construct contextual info 6.   IF FOUND update plugin_desc, BREAK 7.   IF NOT FOUND module = module.parent