nsole>');
  const cwd = tryGetCwd();
  consoleAPIModule.paths = ArrayPrototypeConcat(
    CJSModule._nodeModulePaths(cwd),
    CJSModule.globalPaths
  );
  commandLineApi.require = makeRequireFunction(consoleAPIModule);
}

// Wrap a console implemented by Node.js with features from the VM inspector
function wrapConsole(consoleFromNode, consoleFromVM) {
  const { consoleCall } = internalBinding('inspector');
  for (const key of ObjectKeys(consoleFromVM)) {
    // If global console has the same method as inspector console,
    // then wrap these two methods into one. Native wrapper will preserve
    // the original stack.
    if (ObjectPrototypeHasOwnProperty(consoleFromNode, key)) {
      consoleFromNode[key] = FunctionPrototypeBind(
        consoleCall,
        consoleFromNode,
        consoleFromVM[key],
        consoleFromNode[key]
      );
      ObjectDefineProperty(consoleFromNode[key], 'name', {
        value: key
      });
    } else {
      // Add additional console APIs from the inspector
      consoleFromNode[key] = consoleFromVM[key];
    }
  }
}

// Stores the console from VM, should be set during bootstrap.
let consoleFromVM;
module.exports = {
  installConsoleExtensions,
  sendInspectorCommand,
  wrapConsole,
  get consoleFromVM() {
    return consoleFromVM;
  },
  set consoleFromVM(val) {
    consoleFromVM = val;
  }
};
