| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f8cd96a commit f24f352
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,13 @@ | |||
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | 23 | ||
| 24 | - const { Object } = primordials; | ||
| 24 | + const { | ||
| 25 | + Object: { | ||
| 26 | + setPrototypeOf: ObjectSetPrototypeOf, | ||
| 27 | + keys: ObjectKeys, | ||
| 28 | + values: ObjectValues | ||
| 29 | + } | ||
| 30 | + } = primordials; | ||
| 25 | 31 | ||
| 26 | 32 | const net = require('net'); | |
| 27 | 33 | const EventEmitter = require('events'); | |
@@ -124,8 +130,8 @@ function Agent(options) { | |||
| 124 | 130 | // Don't emit keylog events unless there is a listener for them. | |
| 125 | 131 | this.on('newListener', maybeEnableKeylog); | |
| 126 | 132 | } | |
| 127 | - Object.setPrototypeOf(Agent.prototype, EventEmitter.prototype); | ||
| 128 | - Object.setPrototypeOf(Agent, EventEmitter); | ||
| 133 | + ObjectSetPrototypeOf(Agent.prototype, EventEmitter.prototype); | ||
| 134 | + ObjectSetPrototypeOf(Agent, EventEmitter); | ||
| 129 | 135 | ||
| 130 | 136 | function maybeEnableKeylog(eventName) { | |
| 131 | 137 | if (eventName === 'keylog') { | |
@@ -136,7 +142,7 @@ function maybeEnableKeylog(eventName) { | |||
| 136 | 142 | agent.emit('keylog', keylog, this); | |
| 137 | 143 | }; | |
| 138 | 144 | // Existing sockets will start listening on keylog now. | |
| 139 | - const sockets = Object.values(this.sockets); | ||
| 145 | + const sockets = ObjectValues(this.sockets); | ||
| 140 | 146 | for (let i = 0; i < sockets.length; i++) { | |
| 141 | 147 | sockets[i].on('keylog', this[kOnKeylog]); | |
| 142 | 148 | } | |
@@ -371,7 +377,7 @@ Agent.prototype.destroy = function destroy() { | |||
| 371 | 377 | const sets = [this.freeSockets, this.sockets]; | |
| 372 | 378 | for (let s = 0; s < sets.length; s++) { | |
| 373 | 379 | const set = sets[s]; | |
| 374 | - const keys = Object.keys(set); | ||
| 380 | + const keys = ObjectKeys(set); | ||
| 375 | 381 | for (let v = 0; v < keys.length; v++) { | |
| 376 | 382 | const setName = set[keys[v]]; | |
| 377 | 383 | for (let n = 0; n < setName.length; n++) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments