docs: function populateLegacyOptions(out, args) {
      var r;
  
      assert.object(out, 'out');
      assert.object(args, 'args');
  
      assert.optionalNumber(args.maxConnections, 'args.maxConnections');
      if (typeof (args.maxConnections) == 'number') {
          out.maximum = args.maxConnections;
          out.target = Math.min(out.target, out.maximum);
      }
  
      assert.optionalObject(args.dns, 'args.dns');
      if (args.dns) {
          assert.optionalArrayOfString(args.dns.resolvers,
              'args.dns.resolvers');
          if (Array.isArray(args.dns.resolvers)) {
              out.resolvers = args.dns.resolvers.slice(0);
          }
      }
  
      r = out.recovery;
      if (args.dns && typeof (args.dns.timeout) == 'number') {
          assert.number(args.dns.timeout, 'args.dns.timeout');
          assert.ok(args.dns.timeout >= 0, 'dns timeout must be non-negative');
          r.dns.timeout = args.dns.timeout;
          r.dns_srv.timeout = args.dns.timeout;
  
          /*
           * In the old implementation, the timeout never increased.  Based on
           * experience, that's not reasonable default behavior, so we'll try to
           * use our default maximum unless that's too small.
           */
          if (r.dns.maxTimeout < r.dns.timeout) {
              r.dns.maxTimeout = r.dns.timeout;
              r.dns_srv.maxTimeout = r.dns.maxTimeout;
          }
      }
  
      assert.optionalNumber(args.connectTimeout, 'args.connectTimeout');
      if (typeof (args.connectTimeout) == 'number') {
          assert.ok(args.connectTimeout >= 0,
              'connect timeout must be non-negative');
          r.default.timeout = args.connectTimeout;
          if (r.default.maxTimeout < r.default.timeout) {
              r.default.maxTimeout = r.default.timeout;
          }
      }
  
      assert.optionalObject(args.retry, 'args.retry');
      if (args.retry) {
          assert.optionalNumber(args.retry.retries, 'args.retry.retries');
          if (typeof (args.retry.retries) == 'number') {
              r.default.retries = args.retry.retries;
          }
  
          /*
           * In the legacy interface, the retry policy is specified in terms of
           * timeouts.  Those timeout values really describe the delay between
           * attempts, which we now call "delay".
           */
          assert.optionalNumber(args.retry.minTimeout,
              'args.retry.minTimeout');
          if (typeof (args.retry.minTimeout) == 'number') {
              r.default.delay = args.retry.minTimeout;
  
              if (typeof (args.retry.maxTimeout) == 'number') {
                  assert.ok(args.retry.maxTimeout >=
                      args.retry.minTimeout,
                      'retry.maxTimeout must not be smaller ' +
                      'than retry.minTimeout');
                  r.default.maxDelay = args.retry.maxTimeout;
              } else {
                  r.default.delay = args.retry.minTimeout;
                  if (r.default.maxDelay < r.default.delay) {
                      r.default.maxDelay = r.default.delay;
                  }
              }
          } else if (typeof (args.retry.maxTimeout) == 'number') {
              r.default.maxDelay = args.retry.maxTimeout;
              if (r.default.delay > r.default.maxDelay) {
                  r.default.delay = r.default.maxDelay;
              }
          }
  
          assert.number(r.default.delay);
          assert.number(r.default.maxDelay);
          assert.ok(r.default.delay <= r.default.maxDelay);
      }
  
      if (args.failFast) {
          r.default.retries = 0;
          r.default.delay = 0;
          r.default.maxDelay = 0;
      }
  }