lib: use destructuring for some constants

This change is to unify the declaration for constants into using
destructuring on the top-level-module scope, reducing some redundant
code.

PR-URL: https://github.com/nodejs/node/pull/16063
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
Weijia Wang
2017-10-07 22:50:42 +08:00
committed by Tobias Nießen
parent a3a106865a
commit 212de3c5ec
35 changed files with 132 additions and 135 deletions

View File

@@ -22,14 +22,13 @@
'use strict';
const agent = require('_http_agent');
const client = require('_http_client');
const { ClientRequest } = require('_http_client');
const common = require('_http_common');
const incoming = require('_http_incoming');
const outgoing = require('_http_outgoing');
const server = require('_http_server');
const Server = server.Server;
const ClientRequest = client.ClientRequest;
const { Server } = server;
function createServer(requestListener) {
return new Server(requestListener);