| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f135c38 commit 3b169f1
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'); | |
@@ -129,8 +135,8 @@ function Agent(options) { | |||
| 129 | 135 | // Don't emit keylog events unless there is a listener for them. | |
| 130 | 136 | this.on('newListener', maybeEnableKeylog); | |
| 131 | 137 | } | |
| 132 | - Object.setPrototypeOf(Agent.prototype, EventEmitter.prototype); | ||
| 133 | - Object.setPrototypeOf(Agent, EventEmitter); | ||
| 138 | + ObjectSetPrototypeOf(Agent.prototype, EventEmitter.prototype); | ||
| 139 | + ObjectSetPrototypeOf(Agent, EventEmitter); | ||
| 134 | 140 | ||
| 135 | 141 | function maybeEnableKeylog(eventName) { | |
| 136 | 142 | if (eventName === 'keylog') { | |
@@ -141,7 +147,7 @@ function maybeEnableKeylog(eventName) { | |||
| 141 | 147 | agent.emit('keylog', keylog, this); | |
| 142 | 148 | }; | |
| 143 | 149 | // Existing sockets will start listening on keylog now. | |
| 144 | - const sockets = Object.values(this.sockets); | ||
| 150 | + const sockets = ObjectValues(this.sockets); | ||
| 145 | 151 | for (let i = 0; i < sockets.length; i++) { | |
| 146 | 152 | sockets[i].on('keylog', this[kOnKeylog]); | |
| 147 | 153 | } | |
@@ -381,7 +387,7 @@ Agent.prototype.destroy = function destroy() { | |||
| 381 | 387 | const sets = [this.freeSockets, this.sockets]; | |
| 382 | 388 | for (let s = 0; s < sets.length; s++) { | |
| 383 | 389 | const set = sets[s]; | |
| 384 | - const keys = Object.keys(set); | ||
| 390 | + const keys = ObjectKeys(set); | ||
| 385 | 391 | for (let v = 0; v < keys.length; v++) { | |
| 386 | 392 | const setName = set[keys[v]]; | |
| 387 | 393 | for (let n = 0; n < setName.length; n++) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments