mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
http: destructure primordials in lib/_http_server.js
PR-URL: https://github.com/nodejs/node/pull/30315 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
e1a63a9785
commit
0d285276f8
@ -21,7 +21,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const { Object } = primordials;
|
||||
const {
|
||||
Object: {
|
||||
setPrototypeOf: ObjectSetPrototypeOf,
|
||||
keys: ObjectKeys,
|
||||
}
|
||||
} = primordials;
|
||||
|
||||
const net = require('net');
|
||||
const assert = require('internal/assert');
|
||||
@ -162,8 +167,8 @@ function ServerResponse(req) {
|
||||
};
|
||||
}
|
||||
}
|
||||
Object.setPrototypeOf(ServerResponse.prototype, OutgoingMessage.prototype);
|
||||
Object.setPrototypeOf(ServerResponse, OutgoingMessage);
|
||||
ObjectSetPrototypeOf(ServerResponse.prototype, OutgoingMessage.prototype);
|
||||
ObjectSetPrototypeOf(ServerResponse, OutgoingMessage);
|
||||
|
||||
ServerResponse.prototype._finish = function _finish() {
|
||||
DTRACE_HTTP_SERVER_RESPONSE(this.socket);
|
||||
@ -254,8 +259,8 @@ function writeHead(statusCode, reason, obj) {
|
||||
// Slow-case: when progressive API and header fields are passed.
|
||||
let k;
|
||||
if (obj) {
|
||||
const keys = Object.keys(obj);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const keys = ObjectKeys(obj);
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
k = keys[i];
|
||||
if (k) this.setHeader(k, obj[k]);
|
||||
}
|
||||
@ -337,8 +342,8 @@ function Server(options, requestListener) {
|
||||
this.maxHeadersCount = null;
|
||||
this.headersTimeout = 40 * 1000; // 40 seconds
|
||||
}
|
||||
Object.setPrototypeOf(Server.prototype, net.Server.prototype);
|
||||
Object.setPrototypeOf(Server, net.Server);
|
||||
ObjectSetPrototypeOf(Server.prototype, net.Server.prototype);
|
||||
ObjectSetPrototypeOf(Server, net.Server);
|
||||
|
||||
|
||||
Server.prototype.setTimeout = function setTimeout(msecs, callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user