Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/_http_agent.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,12 @@

'use strict'

const{Object } = primordials;
const{
Object:{
setPrototypeOf: ObjectSetPrototypeOf,
keys: ObjectKeys
}
} = primordials;

const net = require('net');
const EventEmitter = require('events');
Expand DownExpand Up@@ -125,8 +130,8 @@ function Agent(options){
}
});
}
Object.setPrototypeOf(Agent.prototype, EventEmitter.prototype);
Object.setPrototypeOf(Agent, EventEmitter);
ObjectSetPrototypeOf(Agent.prototype, EventEmitter.prototype);
ObjectSetPrototypeOf(Agent, EventEmitter);

Agent.defaultMaxSockets = Infinity;

Expand DownExpand Up@@ -357,7 +362,7 @@ Agent.prototype.destroy = function destroy(){
const sets = [this.freeSockets, this.sockets];
for (let s = 0; s < sets.length; s++){
const set = sets[s];
const keys = Object.keys(set);
const keys = ObjectKeys(set);
for (let v = 0; v < keys.length; v++){
const setName = set[keys[v]];
for (let n = 0; n < setName.length; n++){
Expand Down