| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 93d6b5f commit ae5bcf9
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,7 +160,7 @@ function Client() { | |||
| 160 | 160 | protocol.execute(d); | |
| 161 | 161 | }); | |
| 162 | 162 | ||
| 163 | - protocol.onResponse = this._onResponse.bind(this); | ||
| 163 | + protocol.onResponse = (res) => this._onResponse(res); | ||
| 164 | 164 | } | |
| 165 | 165 | inherits(Client, net.Socket); | |
| 166 | 166 | exports.Client = Client; | |
@@ -735,7 +735,7 @@ function Interface(stdin, stdout, args) { | |||
| 735 | 735 | prompt: 'debug> ', | |
| 736 | 736 | input: this.stdin, | |
| 737 | 737 | output: this.stdout, | |
| 738 | - eval: this.controlEval.bind(this), | ||
| 738 | + eval: (code, ctx, file, cb) => this.controlEval(code, ctx, file, cb), | ||
| 739 | 739 | useGlobal: false, | |
| 740 | 740 | ignoreUndefined: true | |
| 741 | 741 | }; | |
@@ -766,7 +766,7 @@ function Interface(stdin, stdout, args) { | |||
| 766 | 766 | }); | |
| 767 | 767 | ||
| 768 | 768 | // Handle all possible exits | |
| 769 | - process.on('exit', this.killChild.bind(this)); | ||
| 769 | + process.on('exit', () => this.killChild()); | ||
| 770 | 770 | process.once('SIGTERM', process.exit.bind(process, 0)); | |
| 771 | 771 | process.once('SIGHUP', process.exit.bind(process, 0)); | |
| 772 | 772 | ||
@@ -1588,7 +1588,8 @@ Interface.prototype.repl = function() { | |||
| 1588 | 1588 | this.repl.on('exit', exitDebugRepl); | |
| 1589 | 1589 | ||
| 1590 | 1590 | // Set new | |
| 1591 | - this.repl.eval = this.debugEval.bind(this); | ||
| 1591 | + this.repl.eval = (code, ctx, file, cb) => | ||
| 1592 | + this.debugEval(code, ctx, file, cb); | ||
| 1592 | 1593 | this.repl.context = {}; | |
| 1593 | 1594 | ||
| 1594 | 1595 | // Swap history | |
@@ -1603,7 +1604,8 @@ Interface.prototype.repl = function() { | |||
| 1603 | 1604 | // Exit debug repl | |
| 1604 | 1605 | Interface.prototype.exitRepl = function() { | |
| 1605 | 1606 | // Restore eval | |
| 1606 | - this.repl.eval = this.controlEval.bind(this); | ||
| 1607 | + this.repl.eval = (code, ctx, file, cb) => | ||
| 1608 | + this.controlEval(code, ctx, file, cb); | ||
| 1607 | 1609 | ||
| 1608 | 1610 | // Swap history | |
| 1609 | 1611 | this.history.debug = this.repl.rli.history; | |
@@ -1690,8 +1692,8 @@ Interface.prototype.trySpawn = function(cb) { | |||
| 1690 | 1692 | // pipe stream into debugger | |
| 1691 | 1693 | this.child = spawn(process.execPath, childArgs); | |
| 1692 | 1694 | ||
| 1693 | - this.child.stdout.on('data', this.childPrint.bind(this)); | ||
| 1694 | - this.child.stderr.on('data', this.childPrint.bind(this)); | ||
| 1695 | + this.child.stdout.on('data', (text) => this.childPrint(text)); | ||
| 1696 | + this.child.stderr.on('data', (text) => this.childPrint(text)); | ||
| 1695 | 1697 | } | |
| 1696 | 1698 | ||
| 1697 | 1699 | this.pause(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -704,14 +704,15 @@ function SecurePair(context, isServer, requestCert, rejectUnauthorized, | |||
| 704 | 704 | this._rejectUnauthorized); | |
| 705 | 705 | ||
| 706 | 706 | if (this._isServer) { | |
| 707 | - this.ssl.onhandshakestart = onhandshakestart.bind(this); | ||
| 708 | - this.ssl.onhandshakedone = onhandshakedone.bind(this); | ||
| 709 | - this.ssl.onclienthello = onclienthello.bind(this); | ||
| 710 | - this.ssl.onnewsession = onnewsession.bind(this); | ||
| 707 | + this.ssl.onhandshakestart = () => onhandshakestart.call(this); | ||
| 708 | + this.ssl.onhandshakedone = () => onhandshakedone.call(this); | ||
| 709 | + this.ssl.onclienthello = (hello) => onclienthello.call(this, hello); | ||
| 710 | + this.ssl.onnewsession = | ||
| 711 | + (key, session) => onnewsession.call(this, key, session); | ||
| 711 | 712 | this.ssl.lastHandshakeTime = 0; | |
| 712 | 713 | this.ssl.handshakes = 0; | |
| 713 | 714 | } else { | |
| 714 | - this.ssl.onocspresponse = onocspresponse.bind(this); | ||
| 715 | + this.ssl.onocspresponse = (resp) => onocspresponse.call(this, resp); | ||
| 715 | 716 | } | |
| 716 | 717 | ||
| 717 | 718 | if (process.features.tls_sni) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -392,11 +392,11 @@ TLSSocket.prototype._init = function(socket, wrap) { | |||
| 392 | 392 | ssl.setVerifyMode(requestCert, rejectUnauthorized); | |
| 393 | 393 | ||
| 394 | 394 | if (options.isServer) { | |
| 395 | - ssl.onhandshakestart = onhandshakestart.bind(this); | ||
| 396 | - ssl.onhandshakedone = onhandshakedone.bind(this); | ||
| 397 | - ssl.onclienthello = onclienthello.bind(this); | ||
| 398 | - ssl.oncertcb = oncertcb.bind(this); | ||
| 399 | - ssl.onnewsession = onnewsession.bind(this); | ||
| 395 | + ssl.onhandshakestart = () => onhandshakestart.call(this); | ||
| 396 | + ssl.onhandshakedone = () => onhandshakedone.call(this); | ||
| 397 | + ssl.onclienthello = (hello) => onclienthello.call(this, hello); | ||
| 398 | + ssl.oncertcb = (info) => oncertcb.call(this, info); | ||
| 399 | + ssl.onnewsession = (key, session) => onnewsession.call(this, key, session); | ||
| 400 | 400 | ssl.lastHandshakeTime = 0; | |
| 401 | 401 | ssl.handshakes = 0; | |
| 402 | 402 | ||
@@ -410,8 +410,8 @@ TLSSocket.prototype._init = function(socket, wrap) { | |||
| 410 | 410 | } | |
| 411 | 411 | } else { | |
| 412 | 412 | ssl.onhandshakestart = function() {}; | |
| 413 | - ssl.onhandshakedone = this._finishInit.bind(this); | ||
| 414 | - ssl.onocspresponse = onocspresponse.bind(this); | ||
| 413 | + ssl.onhandshakedone = () => this._finishInit(); | ||
| 414 | + ssl.onocspresponse = (resp) => onocspresponse.call(this, resp); | ||
| 415 | 415 | ||
| 416 | 416 | if (options.session) | |
| 417 | 417 | ssl.setSession(options.session); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,8 +33,12 @@ function Worker(options) { | |||
| 33 | 33 | ||
| 34 | 34 | if (options.process) { | |
| 35 | 35 | this.process = options.process; | |
| 36 | - this.process.on('error', this.emit.bind(this, 'error')); | ||
| 37 | - this.process.on('message', this.emit.bind(this, 'message')); | ||
| 36 | + this.process.on('error', (code, signal) => | ||
| 37 | + this.emit('error', code, signal) | ||
| 38 | + ); | ||
| 39 | + this.process.on('message', (message, handle) => | ||
| 40 | + this.emit('message', message, handle) | ||
| 41 | + ); | ||
| 38 | 42 | } | |
| 39 | 43 | } | |
| 40 | 44 | util.inherits(Worker, EventEmitter); | |
@@ -337,7 +341,9 @@ function masterInit() { | |||
| 337 | 341 | process: workerProcess | |
| 338 | 342 | }); | |
| 339 | 343 | ||
| 340 | - worker.on('message', this.emit.bind(this, 'message')); | ||
| 344 | + worker.on('message', (message, handle) => | ||
| 345 | + this.emit('message', message, handle) | ||
| 346 | + ); | ||
| 341 | 347 | ||
| 342 | 348 | worker.process.once('exit', function(exitCode, signalCode) { | |
| 343 | 349 | /* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1842,7 +1842,7 @@ ReadStream.prototype.close = function(cb) { | |||
| 1842 | 1842 | this.once('open', close); | |
| 1843 | 1843 | return; | |
| 1844 | 1844 | } | |
| 1845 | - return process.nextTick(this.emit.bind(this, 'close')); | ||
| 1845 | + return process.nextTick(() => this.emit('close')); | ||
| 1846 | 1846 | } | |
| 1847 | 1847 | this.closed = true; | |
| 1848 | 1848 | close(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -322,7 +322,7 @@ Socket.prototype._onTimeout = function() { | |||
| 322 | 322 | Socket.prototype.setNoDelay = function(enable) { | |
| 323 | 323 | if (!this._handle) { | |
| 324 | 324 | this.once('connect', | |
| 325 | - enable ? this.setNoDelay : this.setNoDelay.bind(this, enable)); | ||
| 325 | + enable ? this.setNoDelay : () => this.setNoDelay(enable)); | ||
| 326 | 326 | return this; | |
| 327 | 327 | } | |
| 328 | 328 | ||
@@ -336,7 +336,7 @@ Socket.prototype.setNoDelay = function(enable) { | |||
| 336 | 336 | ||
| 337 | 337 | Socket.prototype.setKeepAlive = function(setting, msecs) { | |
| 338 | 338 | if (!this._handle) { | |
| 339 | - this.once('connect', this.setKeepAlive.bind(this, setting, msecs)); | ||
| 339 | + this.once('connect', () => this.setKeepAlive(setting, msecs)); | ||
| 340 | 340 | return this; | |
| 341 | 341 | } | |
| 342 | 342 | ||
@@ -384,7 +384,7 @@ Socket.prototype._read = function(n) { | |||
| 384 | 384 | ||
| 385 | 385 | if (this._connecting || !this._handle) { | |
| 386 | 386 | debug('_read wait for connection'); | |
| 387 | - this.once('connect', this._read.bind(this, n)); | ||
| 387 | + this.once('connect', () => this._read(n)); | ||
| 388 | 388 | } else if (!this._handle.reading) { | |
| 389 | 389 | // not already reading, start the flow | |
| 390 | 390 | debug('Socket._read readStart'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments